Shop OBEX P1 Docs P2 Docs Learn Events
RTC and spin how to set? — Parallax Forums

RTC and spin how to set?

mctriviamctrivia Posts: 3,772
edited 2010-08-13 19:52 in Propeller 1
I am having trouble with getting an RTC to work with my prop.

I have the RTC object defined as:

rtc : "DS1302_full"

rtc.setDatetime( _month,_day, _year, _dow, _hour, _min, _sec )
however when I run
rtc.readTime( @_hour, @_min, @_sec ) 'read time from DS1302

I get 65,65 back for hours and min

and when I run

rtc.setDatetime(8,13,2010,6,14,29,0 ) 'month, day, year, day of week, hour, minute, second

it still reads back 65,65

I am using the sparkfun RTC Module. Any ideas what is wrong?

Comments

  • KyeKye Posts: 2,200
    edited 2010-08-13 12:39
    Sparkfun's module is a DS1307.

    Use my driver in the OBEX.
  • mctriviamctrivia Posts: 3,772
    edited 2010-08-13 15:14
    I downloaded http://obex.parallax.com/objects/420/ and change object to


    rtc : "DS1307_RTCEngine"


    the folowing returns all 0s

    rtc.readTime
    _hour:=rtc.ClockHour
    _min:=rtc.ClockMinute
    _sec:=rtc.ClockSecond 'read time from DS1302
    _day:=rtc.ClockDay
    _month:=rtc.ClockMonth
    _year:=rtc.ClockYear
    _dow:=rtc.ClockDate 'read date from DS1302



    this seems to do nothing:

    rtc.writeTime(0,10,17,13,6,8,2010 ) '(second, minute, hour, day, date, month, year)



    before first time accessing clock I run this:

    rtc.RTCEngineStart(29,28,-1)



    ??? help
  • KyeKye Posts: 2,200
    edited 2010-08-13 18:49
    Did you use pull up resistors? The code works.

    Use the built in demo. It tells you what is going wrong.
  • mctriviamctrivia Posts: 3,772
    edited 2010-08-13 19:52
    ah there is only 1 pull up. will try adding second.
Sign In or Register to comment.