|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Timers in Eth board 1.3HHi 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. The nut OS Api's provides me only the time in milliseconds. Hence I request you to provide me the details of Timer1 and Timer2 which is available to user and to configure them. I want to use them as separately configuring the registers and starting and stopping the timers. (As a low level driver), please help me where can I get these details? And any examples of configuring timers like this? I went in NutWiki but if I click the samples I am not getting any information even though I have logged in. Please help me since I am very new in this area and just started to using this board 1.3H Thanks Warm Regards Prasad _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion |
|
|
Re: Timers in Eth board 1.3HHi
If you're using the standard nut/os configuration and are happy with 30.5 us resolution, you can use btn_get_rtc() from here: http://btnode.cvs.sourceforge.net/viewvc/btnode/btnut/btnode/time/btn-time.c?revision=1.4&view=markup m. On 02.06.2009, at 10:48, <Prasad.Nagapati@...> wrote: > 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. The nut OS Api's provides me only the time in > milliseconds. > > Hence I request you to provide me the details of Timer1 and Timer2 > which > is available to user and to configure them. I want to use them as > separately configuring the > > registers and starting and stopping the timers. (As a low level > driver), > please help me where can I get these details? And any examples of > configuring timers like this? > > I went in NutWiki but if I click the samples I am not getting any > information even though I have logged in. > > Please help me since I am very new in this area and just started to > using this board 1.3H > > Thanks > > Warm Regards > Prasad > _______________________________________________ > http://lists.egnite.de/mailman/listinfo/en-nut-discussion _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion |
|
|
|
|
|
Re: Timers in Eth board 1.3HHi 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. Regards Prasad -----Original Message----- From: en-nut-discussion-bounces@... [mailto:en-nut-discussion-bounces@...] On Behalf Of Dusan Ferbas Sent: Wednesday, June 03, 2009 1:49 PM To: en-nut-discussion@... 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: http://www.ethernut.de/nutwiki/Timer_and_Counter_Interrupts. 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 = 14745600/number_of_required_counts timer_divisor = 14745600/freq_divisor (rounded value if integer arithmetics was used) #define TIMER1_DIVISOR_20us 14745600/295 //NUT_CPU_FREQ/... #define TIMER1_DIVISOR_50us 14745600/737 Note: For details look for TCCR1B register description (page 134 - 135 in ATmega128 data sheet).========================== >http://www.ethernut.de/nutwiki/Talk:Nut/OS_Examples At 12:00 2.6.2009, you wrote: >From: <Prasad.Nagapati@...> >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. Dusan _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion |
| Free embeddable forum powered by Nabble | Forum Help |