CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Frequency problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
acidice333



Joined: 14 Oct 2006
Posts: 33

View user's profile Send private message

Frequency problem
PostPosted: Wed Apr 11, 2007 6:14 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 11, 2007 6:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 12, 2007 6:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 12, 2007 6:57 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Apr 17, 2007 7:18 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group