View previous topic :: View next topic |
Author |
Message |
acidice333
Joined: 14 Oct 2006 Posts: 33
|
Frequency problem |
Posted: Wed Apr 11, 2007 6:14 pm |
|
|
I am using this demo code, http://www.ccsinfo.com/forum/viewtopic.php?p=79168
And my source is the G- of the car ECU. With my cheap multimeter connected, I see 20hz which is 1200RPM, 50hz at 3000RPM. etc. Now when I connect the PIC, I get unstable readings, could be 100hz, could be 2000hz its all random.
Its a hardware problem, but I'm not sure what is the best way to fix it.
If I connected it to an injector wire then it reads correctly, but I don't want to read from the injectors because when I let off the gas the reading doesn't change until it drops to the certain RPM. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Apr 11, 2007 6:39 pm |
|
|
You need to put an oscilloscope on the signal and see what it looks like.
Is it a 5v CMOS compatible signal ? That's what you need for the CCP
input to the PIC. |
|
|
acidice333
Joined: 14 Oct 2006 Posts: 33
|
|
Posted: Thu Apr 12, 2007 6:42 pm |
|
|
Unfortunately I don't have a oscope. I didn't think that would matter much since on my $40 multimeter it showed a stable 20hz reading whereas the PIC would show random values, but the values would increase as I increased the frequency. But them again, I'm a complete amatuer (: |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 12, 2007 6:57 pm |
|
|
I connected a function generator to a BK2706A multimeter and set
the meter on "Hz". I adjusted the signal to be 20 Hz sine wave.
The meter displayed the correct frequency even if the peak to peak
voltage on the incoming sine wave was only 1.4v.
It also worked if the incoming signal was mostly below ground.
If any of these things are true, your PIC won't see the signal.
In other words, having it work on the meter doesn't mean it's
going to work on the PIC.
You really have to know what the signal is and then if needed,
design in a signal conditioning circuit. This might involve adjusting
the amplitude of the signal, changing the DC offset, and squaring
up the waveform (changing it from a sine wave to a square wave).
I did this on a tachometer project. It's done with op-amps.
But you have to know the characteristics of the input signal in order
to design the circuit. |
|
|
acidice333
Joined: 14 Oct 2006 Posts: 33
|
|
Posted: Tue Apr 17, 2007 7:18 pm |
|
|
Thanks for the help. If I run it thu a 4n25, I get stable 200-250hz and with the multimeter its 30-35hz so I'm getting somewhere. From the wiring schematics, the signal wire where I am getting it fron the car is from the negative side of the coil. |
|
|
|