RTC -dspMIAC

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times
Contact:

RTC -dspMIAC

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: RTC -dspMIAC

Post 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] = ':'

gavo4
Posts: 92
Joined: Sat Aug 25, 2018 7:58 pm
Been thanked: 8 times
Contact:

Re: RTC -dspMIAC

Post by gavo4 »

The Leigh!,

Have it working now..;-)

Regards,

Gavin
Attachments
RTC_MIACdsp.fcfx
(13.3 KiB) Downloaded 235 times

Post Reply