Page 3 of 3

Re: MOD54415 HiResTimer

Posted: Fri May 31, 2013 8:38 am
by dciliske
Yes it does. You said that your new task runs with priority MAIN_PRIO+1. MAIN_PRIO+1 is higher/larger than MAIN_PRIO. That means it will only run when UserMain is not running. That means the only time period in which it gets to run is when an OSTimeDly or *Pend function is called during UserMain.

You also said you have interrupts for reading a PWM (I really hope I'm reading your post wrong!!!). If the PWM signal you're reading is remotely high frequency (>1KHz), you should be using a DMA Timer to sample it. Though thinking about it, you said this was reading an IMU, hence autopilot, so I'll assume the PWM is a Servo drive PWM and is 50 Hz, which should be fine. On that note... PAGING PAUL (He's done/is doing exactly what you're doing).

You're not by chance working on a project for Sparkfun's Autonomous Vehicle Competition, are you?

-Dan

Re: MOD54415 HiResTimer

Posted: Fri May 31, 2013 8:52 am
by rnixon
LEDs are good indicators. For faster times and exact measurements of processing time I use GPIO signals and toggle them. A printf will take a long time and will add to the problem. At a minimum, make sure you know exactly how long your ISR takes so you can do the math on how much margin you have to accomplish your processing.

Re: MOD54415 HiResTimer

Posted: Fri May 31, 2013 1:55 pm
by nicobari
Hi dciliske, thanks for the nice explanation. You are correct that I am trying to make an autopilot and the PWM I am reading in is 50 Hz also this is for my research and not for Sparkfun's Autonomous Vehicle Competition (I wish I was ;)). Also I am using HiResTimer sample my PWM time, which I assume from documentation to be a DMA timer.and yeah yesterday I spent some time with oscilloscope and blinking LED to figure out some interval lengths in my code.

P.S the autopilot is for quadrotor and after removing all the bugs, it is working like a charm.

Thanks again, Regards,
TM