Hello all, I am using the timer A chanel 3 to generate a overlfow interrupt a a fixed period on my DSP56F807. For order job, i want, in my main loop, to read the value of the counter on the fly. I reading directly the Counter (CNTR) register and when read a second time this register the value is always null, as if reading the counter register reset the regsiter and stop the timer. The documentation of user manual (chapiter 14) is not explicit about reading counter on the fly. Is there other documentation on using timer more complete? Is someone use directely the counter regsiter? and how? What is the used of the Hold Register (the documentation is not explicit...) Thanks for help Christian |
|
Reading Timer register on the fly
hello Christian...you can directly read the counter register to see value of the counter.... like that: //************************* unsigned int cnt1; void main(void) { PE_low_level_init(); PESL(TMRA0, QT_WRITE_CONTROL_REG, 0b0011000000000000); PESL(TMRA0, QT_WRITE_COMPARE_REG1, 0xFFFF); cnt1 = PESL(TMRA0, QT_READ_COUNTER_REG, ...); cnt1 = PESL(TMRA0, QT_READ_COUNTER_REG, ...); } also you can use other functions to read and write registrers(like getReg16()).. here is important point: in debug mode when you stop the program, counter continues to run.... //************************************************ --- christian_rosnoblet <> wrote: > > Hello all, > > I am using the timer A chanel 3 to generate a > overlfow interrupt a a > fixed period on my DSP56F807. > For order job, i want, in my main loop, to read the > value of the > counter on the fly. I reading directly the Counter > (CNTR) register > and when read a second time this register the value > is always null, > as if reading the counter register reset the > regsiter and stop the > timer. > The documentation of user manual (chapiter 14) is > not explicit about > reading counter on the fly. Is there other > documentation on using > timer more complete? > Is someone use directely the counter regsiter? and > how? > What is the used of the Hold Register (the > documentation is not > explicit...) > > Thanks for help > > Christian > > __________________________________________________ |
RE: [motoroladsp] Reading Timer register on the fly
The hold registers are used to read multiple counters when the counters are in cascade count mode. When a counter is read, the other cascaded counter values are latched in the hold registers, so that they can subsequently be read independent of there actual count value following the initial counter read. They will be reloaded on a read of any counter register in the group. Thus, random reading of counter registers can upset a latched, multi-counter value. -----Original Message-----
Hello all, I am using the timer A chanel 3 to generate a overlfow
interrupt a a
Thanks for help Christian ------------------------ Yahoo! Groups Sponsor
--------------------~-->
_____________________________________
_____________________________________
To Join: m...@yahoogroups.com To Post: m...@yahoogroups.com To Leave: m...@yahoogroups.com Archives: http://www.yahoogroups.com/group/motoroladsp More Groups: http://www.dsprelated.com/groups.php3
________________________________________________________________________
________________________________________________________________________ This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. This footnote also confirms that this e-mail message has been scanned by MessageLabs in accordance with the Giddings Lewis, LLC e-mail policy. |