Hi I am new to using this device and using the example program to setup the timers provided by TI. It just sets up all four timers at different rates and calls an interrupt on match between the count and period register. I have added some code to toggle an output pin to verify the period. Trouble is the period seems to be out by a factor of two. I have no prescaler on the HSPCLK and no prescaler on the actual timer. I am running at 150MHz so I would presume the timer count would be updated every 6.6ns. It appears though that it is twice this value. Can someone tell me if I am overlooking a register or something. Thanks Jon This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Texas Instruments TMS320F2812
Started by ●July 22, 2005
Reply by ●July 22, 20052005-07-22
maxascent wrote:> Hi > > I am new to using this device and using the example program to setup the > timers provided by TI. It just sets up all four timers at different rates > and calls an interrupt on match between the count and period register. I > have added some code to toggle an output pin to verify the period. Trouble > is the period seems to be out by a factor of two. I have no prescaler on > the HSPCLK and no prescaler on the actual timer. I am running at 150MHz so > I would presume the timer count would be updated every 6.6ns. It appears > though that it is twice this value. Can someone tell me if I am > overlooking a register or something.How often should interrupts occur, and what is the toggle frequency? I ask because you don't say which way your factor of two goes. If your interrupt causes a toggle every millisecond, then the frequency of the toggled waveform should be 500 Hz. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●July 22, 20052005-07-22
Hi Jerry An interrupt occurs on a match between the count and the preset register. The count is then reset and the whole process starts again. It appears that my provlem is confined to the timers in the event manager as the 32-bit timer (timer 0) works fine. This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Reply by ●July 22, 20052005-07-22
maxascent wrote:> Hi Jerry > > An interrupt occurs on a match between the count and the preset register. > The count is then reset and the whole process starts again. It appears > that my provlem is confined to the timers in the event manager as the > 32-bit timer (timer 0) works fine.That's fine as far as it goes, but you don't compare the frequency you find with the frequency you expect, except to report a factor of two somewhere. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●July 23, 20052005-07-23
Ok what I am doing is measuring the width on a scope between the toggles of the pin. So say I measure 100us I divide that by the value in my preset value which gives me the update rate of the timer. Now since I dont have any prescalers set I would assume that this value should be the main clock value of the DSP i.e. 150MHz = about 6.6ns, but I dont get this I get twice this i.e. about 13.4ns. So I can only think that there is something I have overlooked. As far as I can see there is only a prescaler on the timer and one on the clock HSPCLK to the timer and both prescalers are set to 1. So I would imagine that the timer should be updated at 150MHz Jon This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Reply by ●July 23, 20052005-07-23
maxascent wrote:> Ok what I am doing is measuring the width on a scope between the toggles of > the pin. So say I measure 100us I divide that by the value in my preset > value which gives me the update rate of the timer. Now since I dont have > any prescalers set I would assume that this value should be the main clock > value of the DSP i.e. 150MHz = about 6.6ns, but I dont get this I get twice > this i.e. about 13.4ns. So I can only think that there is something I have > overlooked. As far as I can see there is only a prescaler on the timer and > one on the clock HSPCLK to the timer and both prescalers are set to 1. So I > would imagine that the timer should be updated at 150MHzOne last dumb question from me, and then I have to give up because I don't know the processor or have the manual. What you see on the scope is a square wave. The time between toggles is the time of a top or a bottom. You aren't measuring the complete period, are you? That would account for the timings you see. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●July 23, 20052005-07-23
Are you positive that you've set the HSPCLK prescaler correctly? It defaults to /2. There's nothing complicated about these timers so it must be something incredibly simple. Could it be like Jerry said that you're measuring period rather than toggle-time? What is the period that you've configured? You should make sure that it's not such a fast frequency that there is not enough time for the DSP to get into the ISR and toggle the pin. Also, the I/O buffers on this part are spec'd to switch only up to 20 MHz. Brad "maxascent" <johnbean_uk@hotmail.com> wrote in message news:uvCdnbHOcaKHT33fRVn-tg@giganews.com...> Hi > > I am new to using this device and using the example program to setup the > timers provided by TI. It just sets up all four timers at different rates > and calls an interrupt on match between the count and period register. I > have added some code to toggle an output pin to verify the period. Trouble > is the period seems to be out by a factor of two. I have no prescaler on > the HSPCLK and no prescaler on the actual timer. I am running at 150MHz so > I would presume the timer count would be updated every 6.6ns. It appears > though that it is twice this value. Can someone tell me if I am > overlooking a register or something. > > Thanks > > Jon > > This message was sent using the Comp.DSP web interface on > www.DSPRelated.com
Reply by ●July 23, 20052005-07-23
I am not measuring the whole period just the time between toggles. The HSPCLK prescaler is set to 1. The time period is around 20us which should easily be within the spec of the device. The code I am using is from TI website so I really cant understand why I am getting the error. As I have mentioned the 32-bit timer (timer 0) works fine but that is totally seperate from the event manager timers. This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Reply by ●July 24, 20052005-07-24
On Fri, 22 Jul 2005 06:01:46 -0500, "maxascent" <johnbean_uk@hotmail.com> wrote in comp.dsp:> Hi > > I am new to using this device and using the example program to setup the > timers provided by TI. It just sets up all four timers at different rates > and calls an interrupt on match between the count and period register. I > have added some code to toggle an output pin to verify the period. Trouble > is the period seems to be out by a factor of two. I have no prescaler on > the HSPCLK and no prescaler on the actual timer. I am running at 150MHz so > I would presume the timer count would be updated every 6.6ns. It appears > though that it is twice this value. Can someone tell me if I am > overlooking a register or something. > > Thanks > > JonIt sounds like you have the event manager counter set for symmetrical PWM mode. This is what you need for driving three-phase motors, which we do, and we also use it for driving ordinary motors. If you do indeed have symmetrical PWM mode set, the timer works like this: -- It starts from 0 and counts up to the value in the period register. -- It counts down from the period value back to 0. Then it starts all over again. The net result is that the actual timer period two times the value you loaded in the compare register. Check your setting for bits 11 & 10 (TMODE1 and TMODE0) in the TxCON register for whatever timer number you are using.> This message was sent using the Comp.DSP web interface on > www.DSPRelated.comWhy not use a newsreader (almost anything except Outlook Express) and an NNTP host and post here directly? -- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
Reply by ●July 24, 20052005-07-24






