4/6 xmas ice tube clocks reboot q8 sec

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Limnidytis
 
Posts: 20
Joined: Tue Jul 14, 2020 3:23 pm

4/6 xmas ice tube clocks reboot q8 sec

Post by Limnidytis »

Helllo everyone. I have some Xmas ice tube clocks that have a have a problem that I haven’t been able to workout. I used the info from the GitHub repository and had REV D boards made at OSH Park. I sourced the parts from Digikey with a few exceptions due to supply chain issues. In the first group of 6 clocks after some minor solder clean up, all functioned as intended. However, the second group of 6, 4/6 reboot every 8 seconds. As expected time does not advance on any of the clocks. I have read about the reboot issue at various web sites — I purchased some circuit board cleaner and a new brush and cleaned the boards x2 but there was no change in rebooting. I replaced the oscillator one one board, but again the new oscillator was not running. I have also checked the two caps C8, C9 carefully and am certain they are the specified 10 pf. I am ourt of ideas about what to do — suggestions would be appreciated.

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: 4/6 xmas ice tube clocks reboot q8 sec

Post by jarchie »

A reboot every 8 seconds indicates the watchdog is restarting the clock. The watchdog timer is set to 8 seconds, and the timer is reset in the once-per-second interrupt triggered by the clock crystal timer--the same interrupt that advances the time. For the few times I saw this problem, it was always resolved by fussing with the oscillator circuit. So you're on the right track.

With luck, someone more experienced with oscillator circuits can offer better advice, but here is what I would do.

I would examine the boards carefully around the oscillator to check for any differences between the new and old boards. If the new boards look okay, try touching up the joints of the oscillator part of the circuit (C8, C9, Q1, and XTAL1/XTAL2 on the microcontroller). If you've already tried replacing the crystal, it might be worth trying caps of different values near 10 pF. (The new boards might have a different enough parasitic capacitance that C8 and C9 need different values.)

Good luck!
Attachments
The oscillator circuit is a standard clock crystal with two 10pF caps.
The oscillator circuit is a standard clock crystal with two 10pF caps.
microcontroller.png (40.42 KiB) Viewed 999 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: 4/6 xmas ice tube clocks reboot q8 sec

Post by adafruit_support_mike »

Microcontrollers use a Pierce-style oscillator, which is among the most bulletproof and wide-range topologies available. The ends of the crystal are connected by an inverter inside the microcontroller.

The Pierce topology is basically a phase-shift oscillator: an ideal inverter produces what looks like a 180 degree phase shift in a sine wave or square wave, and the propagation delay through the inverter adds a few more degrees of delay. The inverter's output impedance driving the 10pF capacitor at the input end of the crystal acts as a low-pass filter that adds another 45 to 60 degrees of phase shift. Then the circuit automatically finds whatever frequency produces enough phase shift through the crystal to create a total of 360 degrees around the loop.

The value of the load capacitor at the output end of the crystal (and the input end of the inverter) provides fine adjustment of the loop frequency in a sophisticated Pierce oscillator, but doesn't make much difference in a CPU clock. You can vary it by a factor of 1000 without much visible effect.

There are two tests for a Pierce that isn't behaving:

1: Apply a square wave to the input side of the crystal and see if you get a pulse at the output side.

2: Apply a square wave to the output side of the crystal and see if you get a pulse at the input side.

If test 1 fails, it means you have bad connections between the crystal's terminals (not unusual), or a dead crystal (very rare).

If test 2 fails, it means the inverter inside the microcontroller is dead.

If both test 1 and test 2 show signal passing from one end of the crystal to the other, the issue is probably loop gain. Use a square wave much slower than the crystal frequency (1Hz is good) and see if the result at the other side is an oscillation whose amplitude gradually fades away to nothing.

If you do see that, it could mean the inverter doesn't have enough gain (unusual), or there's excess resistance between the inverter's output and the crystal's input.

User avatar
russell 27
 
Posts: 242
Joined: Thu Sep 12, 2013 3:59 pm

Re: 4/6 xmas ice tube clocks reboot q8 sec

Post by russell 27 »

John wrote the firmware and designed the PCB, no one knows more about this clock than he does. If none of the above tests found a solution, the easiest thing you can do, remove the 328p from the incorrectly working clock and install it in one of the working ones. If the clock works as suspected, no issue with the micro controller. This of course doesn't solve your problem, but rules out any problem there. You mentioned a substitution for some parts. Are you using a 32768 crystal with 12.5pf capacitive resistance, as specked in John's parts list. I can't say this would keep the crystal from oscillating otherwise, but the circuit board adds some capacitance, and crystals can be a bit quirky. The Image is an excerpt from the 328p data sheet and gives some information on capacitor selection.
328p data sheet
328p data sheet
1.png (242.43 KiB) Viewed 962 times
Another option that you could try, which again will not solve your problem at hand, is to enable the external clock bit in John's config.h settings. This enables EXCLK bit in ASSR register so an external oscillator can be connected to pin 9 TOSC1. You would need to remove the existing crystal and capacitors first. If this works then you will need determine why, the crystal is not oscillating in circuit.
config.h
config.h
2.png (108.57 KiB) Viewed 962 times
One last option is to send the clock frequency from the 32768 crystal to the CLKO pin, I believe pin 14. This involves changing one of the configuration settings(fuse bits) to do so. The only problem with this method is you may need a high voltage programmer to set the fuse configuration back.

Hopefully some of these options are of help to you.

Russell

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: 4/6 xmas ice tube clocks reboot q8 sec

Post by jarchie »

My knowledge of oscillators is fairly rudimentary, so I appreciate the help on this one. Thank you adafruit_support_mike and russell 27! It's always a pleasure to learn new debugging tips.

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”