[En-Nut-Discussion] Timers in Eth board 1.3H

Prasad.Nagapati at infineon.com Prasad.Nagapati at infineon.com
Wed Jun 3 10:32:10 CEST 2009

Hi Dusan,

Thanks for the code snippet,

Now I have understood the timer functionality completely. 

Since I want to measure time between two events, I will start the timer
at 1st event and stop it at the next event and count will give me the
exact time between the events.

I reffered the ATmega128 data sheet :-)

Thank you all again.


-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Dusan Ferbas
Sent: Wednesday, June 03, 2009 1:49 PM
To: en-nut-discussion at egnite.de
Subject: Re: [En-Nut-Discussion] Timers in Eth board 1.3H

Hi Prasad,

I used a prepared page title to store a code snippet to the NutWiki:
This example shows how to setup timer1 for ms periods.

How exact microsecond period you need ?
If not too exact, use following calculations:
number_of_required_counts = 1/(period_ms/1000000) freq_divisor =
timer_divisor = 14745600/freq_divisor (rounded value if integer
arithmetics was used)

#define TIMER1_DIVISOR_20us             14745600/295
#define TIMER1_DIVISOR_50us             14745600/737

Note: For details look for TCCR1B register description (page 134 - 
135 in ATmega128 data sheet).==========================

At 12:00 2.6.2009, you wrote:
 >From: <Prasad.Nagapati at infineon.com>
 >Date: Tue, 2 Jun 2009 16:48:37 +0800
 >Hi All,
 >I have many doubts regarding the Timer and counter in the Eth board.
 >Since I am very new to this area (Not the timer and counter :-) but in
 >the board level programming)
 >I want to measure the events in microseconds, so I need a much bigger
 >resolution timer. ...
 >I went in NutWiki but if I click the samples I am not getting any
 >information even though I have logged in.



More information about the En-Nut-Discussion mailing list