futz
Active Member
After playing with PICC and the 16F877 to try to help engkhlaif, just for fun I carried on and interfaced a DS1302 RTC chip to make a very simple clock. It's real experimental at this point. There are no buttons to set the clock. I use hard coded values in clockset.c to set it and clock.c to just use it.
View attachment clockset.c
View attachment clock.c
It has a .33F supercap as battery backup.
![pic16f877_1302_002sm.jpg pic16f877_1302_002sm.jpg](https://www.electro-tech-online.com/data/attachments/16/16017-34918cb49206ed7aacddc48db831fdeb.jpg)
Even though I've read a lot of stuff about breadboard capacitance affecting the watch crystal on the DS1302, mine works just fine stuffed into the breadboard by the chip.
![pic16f877_1302_004sm.jpg pic16f877_1302_004sm.jpg](https://www.electro-tech-online.com/data/attachments/16/16018-944aa20df627398f44488e491b4e72ab.jpg)
I've had much entertainment out of this one. Figuring out the 1302 was tough at first, but once you get "over the hump" it's pretty simple.![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
View attachment clockset.c
View attachment clock.c
It has a .33F supercap as battery backup.
![pic16f877_1302_002sm.jpg pic16f877_1302_002sm.jpg](https://www.electro-tech-online.com/data/attachments/16/16017-34918cb49206ed7aacddc48db831fdeb.jpg)
Even though I've read a lot of stuff about breadboard capacitance affecting the watch crystal on the DS1302, mine works just fine stuffed into the breadboard by the chip.
![pic16f877_1302_004sm.jpg pic16f877_1302_004sm.jpg](https://www.electro-tech-online.com/data/attachments/16/16018-944aa20df627398f44488e491b4e72ab.jpg)
I've had much entertainment out of this one. Figuring out the 1302 was tough at first, but once you get "over the hump" it's pretty simple.