s2000 cluster project

Kschwiggy

New Member
I was able to find a straight tach signal from my ECU... but it's still a V6 rpm signal, so the s2k cluster is showing 1.5 times the true engine speed... should I program another pic with a converter for that signal or rig up a few multipliers and dividers to do the trick? i guess I could do multiply by 2 then divide by 3... if there is a divide by 3
 

orthello

The Dutch Guy
If that signal is a 5v square wave, you could deside to have a second 'VSS converter' with altered parameters in the software and without the 4 divider.

In detail... find the line: Fout = 39000000 /(ttm * 8 ) (clock at 4MHz)

This is the 39 multiplier without the divider at the output.
work it back to a 1:1 situation wil be: Fout = 1000000 /(ttm * 8 )
Now we want divide by 1.5 (which is simular to multiply by 3 and divide by 2)

So change the line in the VSS converter software to: Fout = 3000000 /(ttm * 16)
And to omit problems with overflows (ttm * 16) can potentialy overflow change the line to:
Fout = 187500 / ttm






And to be honest... the original line should be: Fout = 4875000 / ttm
But to keep clear what is happening, I keep it is the other form. Although the short notation will be faster.
 
Last edited:

Kschwiggy

New Member
If that signal is a 5v square wave, you could deside to have a second 'VSS converter' with altered parameters in the software and without the 4 divider.

In detail... find the line: Fout = 39000000 /(ttm * 8 ) (clock at 4MHz)

This is the 39 multiplier without the divider at the output.
work it back to a 1:1 situation wil be: Fout = 1000000 /(ttm * 8 )
Now we want divide by 1.5 (which is simular to multiply by 3 and divide by 2)

So change the line in the VSS converter software to: Fout = 3000000 /(ttm * 16)
And to omit problems with overflows (ttm * 16) can potentialy overflow change the line to:
Fout = 187500 / ttm






And to be honest... the original line should be: Fout = 4875000 / ttm
But to keep clear what is happening, I keep it is the other form. Although the short notation will be faster.
i have to measure again but i believe at lower engine speeds the frequency was less than 254.. i think it may have been as low as 50hz at idle. thats why i was thinking about poss using multipliers and dividers.. any thoughts? i'll measure again this evening
 


orthello

The Dutch Guy
i have to measure again but i believe at lower engine speeds the frequency was less than 254.. i think it may have been as low as 50hz at idle. thats why i was thinking about poss using multipliers and dividers.. any thoughts? i'll measure again this evening
Just handle it, as if it is a VSS signal.
 

tuned86

New Member
another decent option for code can be mikrobasic - I've used this with success and it has a 2k limit. The PWM function is only 8bits - i had to define my own to run 10bits. You can also use CCP to capture rising edge pulses.
 

Kschwiggy

New Member
i had a lot of trouble connecting to my programmer... so i ended up using a code my friend wrote in picbasic pro for a different project but same idea in terms of coding. it counts pulses for 1/8 second, multiplies by the proper factors, and outputs the pulses. ran very fast and smoothly.. should be hooking it up to the car this weekend.

here are a few shots of popping the s2k cluster in to the car and the 4 gauge pod i'm working on
http://www.v6performance.net/forums/showpost.php?p=1508974&postcount=178
 


Kschwiggy

New Member
since we're on the idea of full disclosure here... heres the code i got from my friend and modified a bit for my project.

this code was written in picbasic pro version 2.5 and is to convert the RPM signal (since i have a v6 which is 1.5 times higher pulses than 4cyl). the code also further modifies the signal so that the RPMs will fill the entire s2k cluster... therefore i will take off the numbered scale and put my own scale on there (my redline is 7k)

the same code can be used for the speed conversion as well... just multiply the measured pulses SF by 39 instead of by 2/3 which is what i did here.

the device used here is a huggge 18f4550 pic since that was on hand but the code should work with anything. the LCD lines are not necessary... but the development board im working with has an LCD so it's useful for testing.



Define LOADER_USED 1
Define OSC 4
Define LCD_DREG PORTD
Define LCD_DBIT 4
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1

define hpwm2_timer 1
define ccp2_reg portc
define ccp2_bit 2
X var word
y Var word
f var word
sf var long ;32 bit math
Trisa = 255
TRISB = 0
TRISC = %10100000 ;pins C0 and C2 output, C0 is reset for divider
ADCON1 = %00001010 ' Set PORTA to analog inputs
Low PORTE.2 ' LCD R/W line low (W)
Pause 100
LCDout $FE, $80

PULSOUT PORTC.0, 100 ;send 1m-sec pulse to pin 15 to RESET on counter

Cycle:
count PORTC.1,125,F ;count pulses for 1/8 second
sf = f * 8 ;multiply by 8 for a full second
sf = sf * 8 ; rpm * 4 * 2 ; multiply by 2 for rpm and 4 prescale for divide by 4 counter
sf = sf / 3 ; divide by 3 for rpm counter....now multiplied by 2/3
sf = sf * 1285
sf = sf / 1000 ; now multiplied by 1.323 to use full
ADCIN 0, X
Lcdout $fe, 1 ' Clear screen
y=X * 255
y = y / 4
Lcdout "ADCVAL=", #X, "PWM=", #y
lcdout $FE, $C0, "Count=", #sF
;Pause 500

hpwm 1,127, y

goto Cycle


pins: pin 15 - signal to reset divide by 4 counter. pin 16 - input, pin 17 - output signal to divide by 4 counter.
 

proudtobeawesom

New Member
i dont understand whats being talked about in most of this thread :)

didnt some company make a plug and play harness for this? just wondering?

cant wait to see it working good man :thumbs up

~kevin
 

House Special

I'll KICK YA FUCKIN AASS!
i've seen them working. I don't know what it takes to get there but the end result is awesome. It's just too much work for me.
 

orthello

The Dutch Guy
you can buy a converter for say 100 to 150 USD or GBP
Or you can build a converter yourself for far less then half the price ;)
 
Top