• PicŪ Basic

  • 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.