Page 1 of 1

RTC -dspMIAC

Posted: Wed Dec 12, 2018 10:35 am
by gavo4
Hi All,

Newbee here..;-)

Struggling with the onboard RTC of the dspMIAC (MCP7904), I see we can just right a string to set the time?, if I have a string defined as RTC[20] and use "1234" the Miac acts like a counter starting at 123400 I am a little confused how to either put a "/" or a ":" to separate hours from minutes,

Any ideas?

Regards,

Gavin

Re: RTC -dspMIAC

Posted: Wed Dec 12, 2018 11:30 am
by LeighM
Hi,
The SetTime string is in the format HHMMSS
e.g. "102700" for 10:27

It is the same for the return from GetTime
If you want to display this as 10:27:00 then you will need to use string functions, or something like

Code: Select all

RTC[8] = 0
RTC[7] = RTC[5]
RTC[6] = RTC[4]
RTC[5] = ':'
RTC[4] = RTC[3]
RTC[3] = RTC[2]
RTC[2] = ':'

Re: RTC -dspMIAC

Posted: Sat Dec 15, 2018 5:48 pm
by gavo4
The Leigh!,

Have it working now..;-)

Regards,

Gavin