has anyone code for lpc2148 , to capture rc reciever servo pulse’s
or using timer capture , i try’d using the same basic code outline i had used for an AVR (as has been discussed before and works fine ) , but i must be missing something on an LPC2148 , any ideas please or code snip . anything that would he
i’d like to capture the complete 8 - 9 channels from a futaba reciever
by taking the pulse from the output of the reciever
Dave
I am working on this very thing now. I used the CAP inputs on the LPC2148 set to interrupt on both edges of the pulse. By connecting each input in parrallel with a GPIO you can tell what edge triggered the interrupt. Save the capture times, subtract, and your in business. Now that I think about it, with a long timer period it the GPIO probably isn’t neccesary as it should be obvious from the edge times which is the servo pulse and which is the time between servo pulses.
It should also be possible to use the EINT pins to do the capture by recording the timer value whenver the ISR is called. This should allow the timer to be used for other purposes, but must meet a few constraints. The problem with this approach is that anything that delays the ISR call (being in another ISR for example) will cause error in the pulse time.
Also, beware some futaba PCM receivers. Some of them will output pulses on two pins at a time, which depending on how you do your capture can be a real b!tch to deal with. It is also possible to hack directly into the PPM streams on some RXs, though I have never tried.