2015-04-26 06:43 AM
Hello there,
i´m trying to read a rc receivers sumsignal via the PWM input feature. I just took the FW example and changed the ISR routine by placing the ''TIM_GetCapture1(TIM2);'' value into an array corresponding to a counter which is set to zero when a longer pulse than ''x'' is read. It´s a 7 channel signal, but when i try to read moren than two, the sw ''doesn´t work''. If i read a single channel signal it works perfect. I guess i´m not the first one, trying this (allthough i couldn´t find someone else, only a solution for a read of four single single signals). So may be there is a detail in the configuration or in the principle the PWM input works, that i´m missing. best regards!2015-04-26 07:28 AM
Not sure I'd use PWM Input mode for a PPM signal. Remember PWM Input uses two channels to provide period and duty, and resets the counter. Perhaps better to time stamp the edges, and have the interrupt use a state machine, and identify the blank/slack time.
2015-04-26 11:03 PM
Yea, finally i did it like that.
I hoped to get around that.2015-04-27 06:04 AM
Unfortunately the timers aren't ideal for some, they are general purpose and useless for lots of things.
If you wanted to decimate IRQ loading, you could buffer samples with DMA. Initial synchronization, or resync, might be a bit tedious, but solvable.