Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Real Time Clock with the Embedded RTT
PostPosted: Mon Nov 21, 2005 7:04 pm 
Offline
User avatar

Joined: Thu Feb 12, 2004 7:48 pm
Posts: 164
Location: Atmel Corp.
Hi everybody,

Here is an IAR project in order to have a RTC software by using [RTT + RC-Oscillator + a compensation process which is going to be described in future Application Note.
The resulting drift error (with a AT91SAM7S-EK Evalutaion Board) has been equal to 9.9 ppm vs. a watch with static temperature.
With dynamic temperature:
The compensation process is started each 5 second. Thus, this drift error will be, in case the temperature vary slowly vs. compensation delay (5s), near to 10 ppm. This compensation delay can be set in a .h file.
This project gives Date and Time through DBGU to your Hyperterminal application on your pc (use the readme.html small documentation embedded in zip file).

The bin file is attached too in order to burn the application without using IAR project manager (by using SAM-BA for example).

Summary about these 3 following attachments:
The former is the full IAR project for AT91SAM7S256,
The second is the binary file only for the AT91SAM7S64 Evaluation Board,
The latter is the full IAR project for the AT91SAM7S64 Evaluation Board.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 13, 2006 9:45 pm 
Offline

Joined: Sun Mar 20, 2005 6:46 pm
Posts: 29
Location: MEXICO
Please let me know how to download the referenced attachd files for this project. They do not appear in the sticky post.

Thanks.

Aaron

_________________
Aaron


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 9:34 pm 
Offline

Joined: Tue Feb 28, 2006 5:43 pm
Posts: 5
I would like to get the copy of the whole project but I couldn't find
it in the sticky, would you please repost the attached files?
Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 11, 2006 6:36 pm 
Offline

Joined: Sun Mar 20, 2005 6:46 pm
Posts: 29
Location: MEXICO
Hi Lazio,

You can find the project files here: http://rojko.cz/xy/AT91SAM7S256-BasicRT ... A-1_21.zip

_________________
Aaron


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 11, 2006 8:24 pm 
Offline

Joined: Tue Feb 28, 2006 5:43 pm
Posts: 5
Hi xpercad: Got it! Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 6:02 am 
Offline

Joined: Thu Aug 25, 2005 7:06 pm
Posts: 87
Hi - it seems the only link to this project has died. Does anybody know where I can find this project? Thanks!

-Michael


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 11:24 am 
Offline

Joined: Wed Apr 04, 2007 10:46 am
Posts: 1
Check out this link, there is a port of the ATMEL RTT Basic Example to GCC, but i did not have time to test it so far:

http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html[/url]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 9:20 pm 
Offline

Joined: Thu Aug 25, 2005 7:06 pm
Posts: 87
gerthmar wrote:
Check out this link, there is a port of the ATMEL RTT Basic Example to GCC, but i did not have time to test it so far:

http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html[/url]


That is all I could find as well. I had hoped to find the IAR version, but oh well.

Has anybody seen code using the RTT interrupt? I'm having the worst trouble getting it working.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 10:51 am 
Offline

Joined: Wed Apr 25, 2007 10:07 am
Posts: 14
Hi nleahcim,

I wrote an interrupt mechanism for the RTT on a sam7se512 for a 1second tick. I had problems when I used level sensitive system controller ints. I found that I got multiple interrupts on every increment.

I set positive edge triggered and the problem went away. Then I tried using the PIT with edge triggered and consequently missed interrupts! So I switched back to level triggered and the PIT works fine...shame about the RTT! With all the other problems with it we are going to use an external RTC instead!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 28, 2007 8:10 pm 
Offline

Joined: Thu Aug 25, 2005 7:06 pm
Posts: 87
scoobyjh wrote:
Hi nleahcim,

I wrote an interrupt mechanism for the RTT on a sam7se512 for a 1second tick. I had problems when I used level sensitive system controller ints. I found that I got multiple interrupts on every increment.

I set positive edge triggered and the problem went away. Then I tried using the PIT with edge triggered and consequently missed interrupts! So I switched back to level triggered and the PIT works fine...shame about the RTT! With all the other problems with it we are going to use an external RTC instead!

I eventually got my interrupt working as well. I'm using it to be level sensitive and not having the problem that you had, interestingly enough. I'm using hte AT91SAM7X256 though, so maybe that accounts for the difference?

Anyways - how accurate did you find the RTT to be? I'm having terrible problems with it's accuracy.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 9:33 am 
Offline

Joined: Wed Apr 25, 2007 10:07 am
Posts: 14
nleahcim wrote:
I eventually got my interrupt working as well. I'm using it to be level sensitive and not having the problem that you had, interestingly enough. I'm using hte AT91SAM7X256 though, so maybe that accounts for the difference?

Anyways - how accurate did you find the RTT to be? I'm having terrible problems with it's accuracy.


Not sure why level works for you and not me, I thought the RTT peripheral would be the same for the AT91SAM7SE512 as for your processor. Maybe not :)

Anyway, you have to calibrate the RTT at startup and then maybe also at runtime if you need to (depending on the voltage and ambient temperature variations of your environment).

There is an Atmel app note which describes this and I have some code that does it if you are interested. At startup, after you have initialised the clock generator you can calibrate the RTT. I believe that subsequent calibrations need to stop and restart the master clock and PLL, which is annoying because you have to switch the core to clock from the internal oscillator while you do this!

Also, you have to reset the RTT [and this also resets the counter] when calibrating, which doesn't make it a continuous counter.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 12, 2007 12:55 am 
Offline

Joined: Thu Aug 25, 2005 7:06 pm
Posts: 87
scoobyjh wrote:
Not sure why level works for you and not me, I thought the RTT peripheral would be the same for the AT91SAM7SE512 as for your processor. Maybe not :)

Anyway, you have to calibrate the RTT at startup and then maybe also at runtime if you need to (depending on the voltage and ambient temperature variations of your environment).

There is an Atmel app note which describes this and I have some code that does it if you are interested. At startup, after you have initialised the clock generator you can calibrate the RTT. I believe that subsequent calibrations need to stop and restart the master clock and PLL, which is annoying because you have to switch the core to clock from the internal oscillator while you do this!

Also, you have to reset the RTT [and this also resets the counter] when calibrating, which doesn't make it a continuous counter.

So, during run time, is it possible to recalibrate the timer during run time without restarting the master clock? Perhaps is there some way to count the clock from my 18.432MHz crystal? I'm using a really, really high accuracy crystal, so that would be ideal.

Thanks!

-Michael


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 12:25 pm 
Offline

Joined: Wed Apr 25, 2007 10:07 am
Posts: 14
nleahcim wrote:
So, during run time, is it possible to recalibrate the timer during run time without restarting the master clock? Perhaps is there some way to count the clock from my 18.432MHz crystal? I'm using a really, really high accuracy crystal, so that would be ideal.

Thanks!

-Michael


If you want to use the internal compensation feature then no you cannot do it without restarting the master clock. Here is the link to the app note which describes the compensation:
http://www.atmel.com/dyn/products/app_notes.asp?family_id=605#Timers%20and%20Oscillators
It is called:Using a Real-time Timer with Non-calibrated RC Oscillator as Real-time Clock

If however you can find another way of counting the slow clocks using a different clock source then perhaps you can implement your own compensation mechanism without having to stop the master clock.

Sorry for the delay in reply, I have been ill.
Cheers.[/url][/b]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: