EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Pulse counting and pulse duration measurement with PIC

Started by Unknown October 11, 2006
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 http://www.mh.ttu.ee/risto/rc/electronics/radio/signal.htm. 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



<Harry Ja> wrote in message 
news:452ccd8b$0$5107$afc38c87@news.optusnet.com.au...
> 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 > http://www.mh.ttu.ee/risto/rc/electronics/radio/signal.htm. 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 > >
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

Memfault Beyond the Launch