Proton BASIC Compiler - Checking your Pic's clock

  • Checking your Pic's clock

    An easy way to see if your PICŪ is running, and at the desired clock speed, is to use a scope, or a LED and a 1k resistor. The LED's long lead goes to the PICŪ pin and the short lead goes through the 1k resistor to GND (or 0V)

    You can use any pin available on the PICŪ (except the Vpp = Programming pin), and what you need to test is a simple routine

              PortA,0 = 1           ' Switch PICŪ pin On
              Delayms 500          ' Half second delay
              PortA,0 = 0           ' Switch pic pin Off
              Delayms 500          ' Half second delay
              Goto TEST            ' Repeat over and over
    By observing the flash rate of the LED (or the scope's trace), you will see if the rate is about correct.
    Now you know the following -
    The PICŪ is running (phew !)
    The PICŪ clock rate is set correctly
    Code timings is going to work out

    If the PICŪ clock was set incorrectly, the flash rate will be either too fast or too slow.

    If you don't get the LED to flash, then check the PICŪ supply voltage, if ok
    then check the configuration settings, especially the clock source, ie Internal Osc, XT, etc.
    If you're using an Xtal or other external clock, it may be easiest to start by using the internal clock,
    if the PICŪ is running then,
    you know the only problem is either the external oscillator or the configuration clock source.

    If the flash rate is incorrect, then the clock is either specified wrong or the oscillator settings is incorrect.

    Consult the PDF file for the specific PICŪ to set it right.

    PICŪ are easy to get going, if they don't it's usually a small (but important) overlook somewhere.
  • Recent Activity


    Negetive Numbers with minus sign

    Thread Starter: amod

    Hi, Iam making a load indicator with HX711.My Problem is with negetive numbers and minus sign.Iam using 4 digit seven segment display.fourth display...

    keytapper Today, 06:40 Go to last post

    CWrite and ISR

    Thread Starter: joesaliba

    I am struggling to make work CWrite and Interrupt together. If I comment out: - On_Interrupt Isr ' Where to go on an Interrupt ...

    keytapper Today, 05:44 Go to last post

    Sleep and how to use it

    Thread Starter: Tim

    Hi, I need to save power in a device (16f1823) so thought, sleep a lot. But I never really used the command before. Reading the data sheet I...

    towlerg Today, 14:16 Go to last post