ATSAM3X8E RTC Programming in C (Beginners)

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

Posts: 1
Joined: Tue Apr 23, 2019 10:40 pm

ATSAM3X8E RTC Programming in C (Beginners)

Tue Apr 23, 2019 11:16 pm

Hey there, this is my first ever post in any community forum, so I hope that you won't mind me asking very basic questions.

So here is the thing. I'm trying to program RTC in ARDUINO DUE having ATSAM3X8E. I'm making ASF board project in Atmel Studio but since I don't know how to simulate it (by adding break points and checking values in the corresponding registers) and that is because it asks for Custom Programming Tool and I have searched for any software but didn't find any. So I'll be grateful if you could also help me in this area. So, for now I write my C program in Atmel Studio and compile it. But to debug it or check the output, I use Arduino IDE and write the similar program and start serial communication to check the values in the register. Coming to the RTC problem, whenever I start serial communication, it always starts from zero and after 9 it starts jumping to random values. I have loaded the initial values in the RTC_TIMR reg. as below but it seems to have no effect. Also, whenever I try to mask the register to get a certain bit, it always gives zero on serial monitor. Here is my code:

Code: Select all

void setup() {

void loop() {



So, what I'm asking is if anyone can direct me in the right direction or give me the basic code for RTC programming for the particular micro-controller. Also I've to program it only in C and the CMSIS example code is beyond my understanding. The above code is written in main in Atmel studio without serial.
Location: USA
Posts: 1889
Joined: Thu Apr 19, 2007 10:15 pm

Re: ATSAM3X8E RTC Programming in C (Beginners)

Wed Apr 24, 2019 1:21 am

For MCUs try posting at Atmel SMART ARM-based MCUs forums.


Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 3 guests