Pulse counting and pulse duration measurement with PIC

Hi To All,

I have a model airplane in which I want to measure engine RPM and pulse duration measurement with a PIC 18F6680 series micro controller.

The propeller on my airplane has a small magnet and I use a small hall effect sensor to detect rotation as one pulse per revolution. Output of the hall effect sensor is clean TTL Pulses that the frequency and the duration of the pulses changes as the propeller's rotational speed changes.

I'm also trying to hack the radio control receiver and find the pulse stream correponding to the original pulse stream sent from the R/C transmitter. My R/C transmitter has 8 channels and it produce signal waveform as it is well explained in

formatting link
I want the PIC controller to do is decode this multi channel pulse stream and create serial data coresspond to each servo channel position value like (

111, 012, 222, 111, 211, 000, 121, 001).

Can some one show me in PIC C18 compiler (I'm not assembler programmer) how to (1) measure RPM and (2) how to decode servo pulse stream in to array of integer?

Thank you.

Harry Ja

Reply to
<Harry Ja>
Loading thread data ...

I did the pulse width measurements with a PIC16F628 using PIC Basic Pro and assembly. Unlike the transmitter, the receiver didn't have gaps between the channels. The end of one channel was the start of the next channel. I used timer 1 to do the measurements. The critical timing was done in assembly. The resolution was 800 ns per count with the PIC running at 20 MHz. The output of each channel was connected to a pin on the PIC.

I don't have a website to post the source code to, but if you want the code, I could send it to you.

Don

Reply to
Donald Harris

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.