From Tim's website
Jump to: navigation, search

Rugby Clock - Debug Information

Is the oscillator running?

Check the signal on OSC2 (pin 10) - there should be a 4MHz sine wave.

If this isn't observed then check the PIC config word includes either the HS or XT type oscillators.

Is the program running?

Pull the input to pin 2 (AN0) high and low and checking the output of pin 26 (B5) - It should match the input.

If this isn't observed then check the LCD connections (see below).

Does anything appear on the display?

If the screen is completely blank or just a series of black squares then check the contrast input to the LCD.

The message "Please Wait..." should appear at the start.

If you've compiled the CCS version of the program, it will wait for the LCD busy signal. See the Rugby Clock CCS Debug page for details. The Hi-Tech version of the program, which includes the .hex file, does wait for the LCD.

I have created a small project to test the LCD display connection:

LCD test signals

In the test program the Read/Write line is kept low (so the R/W input to the LCD can be connected to ground for the test). The test starts with the RS line low (to send commands) and pulses the Enable line twice to clock two commands across the 8 data lines. The RS line is then taken high and 12 characters are clocked across the 8 data lines with 12 more pulses on the Enable line.

The program waits indefinitely after the 14 writes, so the watchdog timer resets the chip and the program ends up running about once every two seconds.

If you watch the LSB on the data port you should see the values shown in the trace on the right.

The C source and HEX files can be viewed here:

Does a counter increment on the display?

The message "Please Wait..." should appear at the start and the counter should increase once per second if the input to pin 2 (AN0) is receiving pulses from a radio receiver.

If the counter isn't incrementing then check the output of pin 26 (B5) is pulsing approximately once per second, which should follow the input to pin 2 (AN0).

Display counter increments but characters are garbled

There is no consistency checking on the input pulses, so if there are errors on the input then the displayed text will contain errors.

The error LED comes on

The error LED comes on when a pulse is received that doesn't match one of the expected patterns (see the Rugby Clock Circuit page). It will go out when a long pulse is received marking the start of a new minute. If you have a good MSF signal then the clock will function properly and the error LED will stay off. If there are errors in the signal then the display may show invalid or incorrect values and the error LED should come on.

The MSF receivers are susceptible to noise, so if you are not getting consistent pulses try:

  • Disconnecting the programmmer.
  • Moving the circuit away from other electrical items.
  • Using battery power to avoid noise from the PSU.
  • Moving to a higher location.