Description

Hello and welcome to my project, this project is an entrant in the square in contest.

This project is based around my older Numitron clock which is much bigger and powered by mains. This clock has two main sources from which it can be powered and that is a single cell lipo battery (currently 3.7v 400mAh), USB (power only no serial with usb) and the secondary power to keep the RTC from loosing its mind when the power runs dry is a 300mF super cap.

The FW is ported over from my larger clock but alot has changed delays are almost completely gone and replaced with sleep cycles and interrupt routines. Thus making the clock a little less power hungry, currently it runs at 8Mhz and only uses about 60% of program memory.

keep an eye out Rev 2 is out for a spin and once its back I will start working on getting the Numitron to display the time.

Hello everyone, the clock is finally fully functional, minus the buzzer for the alarm and possibly one more board spin to fix a few minor bugs. The bugs don't cause any issues in the way the clock operates, there just things I'd like to fix.

The video demonstrates how the clock functions and what options are enabled on the clock.

I will release board files soon, once I fix the last few bugs, the board will be at rev 2.1 the FW is functionally complete and can be found on Github.

The clock runs at 1Mhz, and utilizes sleep mode (power down mode) a lot through out the clocks operational cycles. There is a user menu operated by two user buttons, allowing the user to set time, set alarm, enable/disable showing of temperature (currently not working properly on display, but works properly in serial?), and show time only when button pressed.

I always think these projects are funny, when I show people (mainly my friends/family) their first thought is cool its a clock. It's hard to get people excited about something that they have no inner working knowledge of. Thus i really do encourage people to build a clock of their own, not only do you learn how multiple systems co-exist but you gain a deeper understanding of how a clock functions. There really is a lot that goes into making a functioning clock.

It is indeed alive. Finally got the sleep routines etc to place nice. everything is running off the lipo battery and its starting to come together. I also found one more hardware bug that i need to fix, but i can deal with it now as its not a show stopper.

Here it is in action.. sorry for the quality of the video, I will upload a more in depth video later.

I'm updating using my phone I will resize the images when I get to a computer.

long story short, the boad is alive. With a few mishaps, the voltage switching circuit has a EN pin that needs to be pulled low, not high. This has been fixed and I can now talk to the DS1337.

Serial is up and running, it's a bit finicky. The clock also seems to be a bit off, both the internal 8MHz and the external. Setting the baud rate to 115200 seems to communicate one baud selection below that.. sometimes it works at the selected baud I'll have to hook the clock to the scope and see what's going on.

There seems to be something funny going on with my interrupts and sleep modes as it will go to sleep and wake up only a few times then go for a toss.. either the heap is crashing or the clock is too unstable.

I have not tested the temp sensor yet as I have been fighting with the rtc and the power rail management.

The gist of the power management system is, that when powered from usb the lipo and super cap charge. When unplugged the system switches over to the lipo and the lipo makes sure the super cap is fully charged. If the lipo falls below operating voltage then the super cap kicks in to power the rtc, as the rtc has no battery backup. The super cap should keep the DS1337 running for at least an hour or so before it dies if not longer I have not yet tested the length of time it stays alive.

Due to space restrictions in the program memory and ram I may switch to an Atmega 328. One more board spin should knock all the bugs out.

Need to recalculate the crystals load caps, that may be the issue. Or I may just go with a 37KHz crystal and do some funny clock jumbling to keep the power down.

finally got home to mess with the board, plugged it in fired up atmel studio 7 and no chip ID.. huh. OK so basic troubleshooting begins.

Check the custom made jtag cable: check pinoit is indeed correct.

Notice the board is getting a little warm : no biggie could just be the super charging..

Board is getting hotter still : look over the board for pin 1 markers BLAH! shift registers foot print is off by one pin the whole way around....

So snatched the shift register off the board and bingo chip ID. So I have made all the required changes in the schematic, connected ground to the super.. pin designator on the foot print was backwards. Went to a 6pin jtag that's still compatible with the current cable. Now I'm getting ready to re spin the board.

While the boards are out for fab I'll start validating the rest of the boards communications between the temp sensor and the rtc.

I have already verified the super charges properly and the system switches over to the super when all other power sources are gone.

USPS finally got my package to me, didn't look in that good of condition to be honest. But the components were fine. The build was quick only taking about an hour. The only thing not currently on the board is the JST connector for the lipo battery as I apparently forgot to put that in my digi-key order and the Numitron itself.

I haven't had a chance yet to see if Atmel studio will communicate with the device using Atmel ICE yet. So unfortunately I only have a few photo's of the build process for you now.

Paste applied and getting ready to stuff parts.The front of the board holds the main micro an Atmega168 an 8bit shift register the DS1337 RTC user buttons and programming interface.

Board has already gone through the oven for the top side, the bottom side was done using a head gun. The bottom of the board holds the Super Cap, the Lipo charger / USB port and the Voltage switch.

Using my Atmel ICE to varifiy it sees the board has power, its hard to see but the green light on the programmer says it can see the voltage on board. Next step from there is to see if Atmel studio can find the Atmega168 controller. If not then checking the schematic to make sure I have the jtag cable pinned properly, it was made in a hurry.

Tiny clock without the tube. Thats pretty much it. Btw I know about the tome-stoned cap on the board I have fixed it since the photo was taken.

Ill post an update when I get the programmer talking to the micro. Until then.

The boards arrived from OSHpark today, they are a lot smaller than I imagined.

The Numitrons are a hair bit bigger than the boards them self's. good thing they allow parts to hang off the board :). I will have to shrink wrap each leg so they don't short out.

My digi-key ordered is somehow delayed, arrival time was set for today two day shipping and seems that it is still in Grand Forks ND as of yesterday. I'm a little irritated as I had time set aside today to build the first version. But hopefully the shipment comes in tomorrow. Waiting for the order, since I don't follow standards.. I had to create a custom JTAG cable for my Atmel ICE programmer to program this board.

Other than that nothing new, I'll update when I get the parts in and hopfully build the board soon.

Today all parts have been ordered from digi-key and should be here within the week. I ordered two lipos from sparkfun as well to test the viability of "battery powered".

Boards should be here tomorrow as well. Some things have changed in the bom as well, mainly due to digi-key not having them in stock. Parts are the same just different part numbers I will update the bom with the new part numbers soon.