Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,304 Views

Intel Edison RTC commands

Hi everyone,

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?

Thanks,

P.S. I program in C using Eclipse.

6 Replies
Highlighted
Employee
14 Views

Hi LoreQuazzo,

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.

Sergio

0 Kudos
Highlighted
Novice
14 Views

Hi Sergio,

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.

Thanks,

Lorenzo

Highlighted
New Contributor III
14 Views

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.

Highlighted
Novice
14 Views

Hi,

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.

Thanks

Highlighted
New Contributor III
14 Views

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:

# include

# include

# include

# include

void print_current_time()

{

time_t now;

now = time(NULL);

printf("%s", ctime(&now));

}

void alarm_handler()

{

print_current_time();

printf("Receive SIGALRM\n");

}

int main()

{

signal(SIGALRM, alarm_handler);

print_current_time();

printf("Arrange SIGALRM to be delivered in 10 seconds\n");

alarm(10);

for (;;);

return 0;

}

0 Kudos
Highlighted
Employee
14 Views

Hi LoreQuazzo,

Were you able to follow Vincenze's suggestion? Do you still need help with this thread?

Sergio

0 Kudos