Micro-C Library Extension for DS1202 Real-time Clock

An 8-pin RTC chip, DS1202 provides an accurate digitalclock for real-time applications. Example circuit shown above requires3-pin for interfacing with 8051 chip, P1.3, P1.4 and P1.5. For the DS1202chip, backup supply, +V requires a signal diode, say 1N914 to switch betweennormal supply and +3V lithium battery. Newer version DS1302 has an internalswitching diode, +3V battery supply can then be connected directly. Myfriend, Santi Hankla, wrote me the library extension for DS1202, DS1202.ASM.The library extension is used with Micro-C Compiler written in Assembly.To use the extension, you have to add the name and label of the DS1202.ASMin the TINY.LIB. He also provides me the example C program, REALTIME.C,sending real-time clock to terminal every second.
 
 
I have tested above circuit with DS5000, soft-microcontroller8051 compatible, it works well. But with ATMEL 89C52,89C55, three 20k resistors should be changed to 40k. Moreover abypassing capacitor, 0.1uF ceramic should be put at Vcc and GND.

Wichit Sirichote, kswichit@kmitl.ac.th



BuildYour Own uC Projects

Last updated, 30 December 2542