I've just chosen to use Edison Board for my university project.
I would like to use the RTC module to set a wake-up alarm, but I don't know how to access RTC register. Could anyone help me?
P.S. I program in C using Eclipse.
The connection differs depending on the expansion board you're using. To use the RTC in either board you need to have a battery or apply power to the proper pins in order for the RTC to work. In the Arduino expansion board you need to look for the header J2. If you're using the mini breakout board look at J18-pin 5.
In this thread you can see more information on how to configure the RTC in Linux.
Let me know if this helps.
Thank you for your quick reply.
I'm using the mini breakout board. I've already applied power to the RTC pin. My problem is about how to program it. I've looked up in the Mraa library but there is no function related to the RTC module.
How about this command line script?
sleep 5s; echo "Alarm"
You probably think about the program rtcwake http://linux.die.net/man/8/rtcwake rtcwake(8) - Linux man page
I think sleep/wakeup is broken on the Edison.
I'm thinking about using the RTC to set a timer. So far, I was used to set the frequency of the RTC and generate an interrupt whenever I wanted. The problem here, It's that I do not know any function to set the RTC.
The function to set the RTC clock is called 'date':
http://www.manpages.info/linux/date.1.html Linux man pages : date (1)
Gooogle SIGALRM interrupts.
Here is an example:
now = time(NULL);
printf("Arrange SIGALRM to be delivered in 10 seconds\n");