PDA

View Full Version : Interfacing with RTC chips like NJU6355



Nicmus
- 26th September 2005, 21:00
Does anyone have some sample code to interface
with NJU6355 RTC. I have a good supply of them
and I’d like to put them to use.

Nick

Nicmus
- 4th October 2005, 18:37
I found a way to "talk" to NJU6355 RTC chip.
Here are read and write subs for it:

settime:
IO = 1
CE = 1
ShiftOut SDATA, CLK, LSBFIRST, [rtcyear, rtcmonth, rtcdate, rtcday\4, rtchr, rtcmin]
CE = 0
Return
gettime:
IO = 0
CE = 1
ShiftIn SDATA, CLK, LSBPRE, [rtcyear, rtcmonth, rtcdate, rtcday\4, rtchr, rtcmin, rtcsec]
CE = 0
Return

Nick

Nicmus
- 4th October 2005, 19:22
Now, I understand that I can send the values of
time (hours, minutes and seconds) serially as HEX2 values to a terminal.
I also understand that the RTC chip will show a string of "E"s if
the time is not set.
How can I catch that?
What do I need to do to be able to use logical operators and make sure
I'm comparing aples with aples?
Should I start a new thread or keep this one?

Nick