fxvxca said:hi guys i'm triyng to find a schematic for gear indicator for my gixxer that take signal from speed and rpm signl (plus neutral light for zero) but it seems that it doesn't exist anywhere... do you have any idea?
fxvxca said:hi guys i'm triyng to find a schematic for gear indicator for my gixxer that take signal from speed and rpm signl (plus neutral light for zero) but it seems that it doesn't exist anywhere... do you have any idea?
Pommie said:Thanks Nigel,
The EPE article available on your friends site is excellent.
Pommie said:For all of the circuits presented here, it would make sense to replace the 16F876 with a 16F88. This is a much smaller chip (18 pin) but has all the required peripherals plus it has an internal 8MHz clock.
It probably won't be able to handle the graphical display. BTW, if you find a good site explaining interfacing and programming the graphical displays, can you post it here. Thanks.
Mike.
quickrik said:I'll get the Gear thing going once I get the speed and rev counter working.
I've got the maths and the programming covered. Its the electronics I'm no good at. And wiring a 5v pic to a 12v bike scares the hell out of me. So I'm really interested in the schematics that connect directly into the bikes loom. to give me a good clean speed and rev pulse. Was there not talk of a Zenner diode in here somewhere?
Device 16F877A
Declare XTAL 4
DECLARE ADIN_RES 10 ' 10-bit result required
DECLARE ADIN_TAD 8_FOSC ' Set the ADC's clock source
DECLARE ADIN_STIME 50 ' Allow 50us sample time
Declare LCD_TYPE 0 ' Type of LCD Used is Alpha
Declare LCD_DTPIN PORTB.4 ' The control bits B4,B5,B6,B7
Declare LCD_RSPIN PORTB.2 ' RS pin on B2
Declare LCD_ENPIN PORTB.3 ' E pin on B3
Declare LCD_INTERFACE 4 ' Interface method is 4 bit
Dim ADC_Result As Float
Dim ADC_Total As Float
Dim Temp_Float as Float
Dim ADC_Channel as Byte
Dim ADC_Loops as Word
Dim Temp as Word
Dim Last_Result1 As Float
Dim Last_Result2 As Float
ADCON1 = %10000000 ' Set all to analogue inputs (PORTA)
TRISA = $FF ' Declare porta as all inputs
Delayms 150
Cls
Print $FE,$40,$07,$05,$07,$00,$00,$00,$00,$00 ' Custom character for Degree
ADC_Loops = 200
Main:
ADC_Channel = 1 ' ADC on first reference
Gosub ADC_Average ' Perform an averaging to enhance accuracy
Temp_Float = ADC_Result ' Store the result
ADC_Channel = 0 ' ADC on second reference
Gosub ADC_Average ' Perform an averaging to enhance accuracy
ADC_Result = ADC_Result * 5000 / 1023 ' Convert values into Volts (with a scale of 1000)
Temp_Float = Temp_Float * 5000 / 1023 ' to reduce decimal error
ADC_Result = ADC_Result - Temp_Float ' And calculate difference
ADC_Result = ADC_Result / 10 ' Scale back down remembering 10mV = 1 Deg C
If ADC_Result <> Last_Result1 Then ' Check if the data has changed
Print At 1,1, Dec1 ADC_Result, 0, "C " ' and only update display if it has
Last_Result1 = ADC_Result ' Store new data
Endif
Goto Main ' Loop for ever
ADC_Average: ' Perform an averaging on ADC conversions
' to reduce errors
ADC_Total = 0 ' Clear summing register
For Temp = 1 To ADC_Loops ' Loop for a pre-determined number of times
ADC_Result = ADIN ADC_Channel ' Grab a new ADC value
ADC_Total = ADC_Total + ADC_Result ' Sum it to the total register
Delayus 1 ' Allow internal capacitors to discharge
Next Temp
ADC_Result = ADC_Total / ADC_Loops ' Determin the average of all the equations
Return
gramo said:Nice work Kiko, I'm glad to see a whole project pan out so well, if you decide to throw in a temp sensor, maybe this will help
The datasheet shows many ways to use the LM35DZ, but I'm using the example on page 7 in the datasheet, with the -55 to +150 degree C application. It requires 3 additional components, 2 * 1N914 (Or 1N4148), and 1 * 18K resistor.
**broken link removed**
Code:Device 16F877A Declare XTAL 4 DECLARE ADIN_RES 10 ' 10-bit result required DECLARE ADIN_TAD 8_FOSC ' Set the ADC's clock source DECLARE ADIN_STIME 50 ' Allow 50us sample time Declare LCD_TYPE 0 ' Type of LCD Used is Alpha Declare LCD_DTPIN PORTB.4 ' The control bits B4,B5,B6,B7 Declare LCD_RSPIN PORTB.2 ' RS pin on B2 Declare LCD_ENPIN PORTB.3 ' E pin on B3 Declare LCD_INTERFACE 4 ' Interface method is 4 bit Dim ADC_Result As Float Dim ADC_Total As Float Dim Temp_Float as Float Dim ADC_Channel as Byte Dim ADC_Loops as Word Dim Temp as Word Dim Last_Result1 As Float Dim Last_Result2 As Float ADCON1 = %10000000 ' Set all to analogue inputs (PORTA) TRISA = $FF ' Declare porta as all inputs Delayms 150 Cls Print $FE,$40,$07,$05,$07,$00,$00,$00,$00,$00 ' Custom character for Degree ADC_Loops = 200 Main: ADC_Channel = 1 ' ADC on first reference Gosub ADC_Average ' Perform an averaging to enhance accuracy Temp_Float = ADC_Result ' Store the result ADC_Channel = 0 ' ADC on second reference Gosub ADC_Average ' Perform an averaging to enhance accuracy ADC_Result = ADC_Result * 5000 / 1023 ' Convert values into Volts (with a scale of 1000) Temp_Float = Temp_Float * 5000 / 1023 ' to reduce decimal error ADC_Result = ADC_Result - Temp_Float ' And calculate difference ADC_Result = ADC_Result / 10 ' Scale back down remembering 10mV = 1 Deg C If ADC_Result <> Last_Result1 Then ' Check if the data has changed Print At 1,1, Dec1 ADC_Result, 0, "C " ' and only update display if it has Last_Result1 = ADC_Result ' Store new data Endif Goto Main ' Loop for ever ADC_Average: ' Perform an averaging on ADC conversions ' to reduce errors ADC_Total = 0 ' Clear summing register For Temp = 1 To ADC_Loops ' Loop for a pre-determined number of times ADC_Result = ADIN ADC_Channel ' Grab a new ADC value ADC_Total = ADC_Total + ADC_Result ' Sum it to the total register Delayus 1 ' Allow internal capacitors to discharge Next Temp ADC_Result = ADC_Total / ADC_Loops ' Determin the average of all the equations Return
The comments went all over the place, but you should be able to ge tthe jist of it
fxvxca said:hi guys i'm triyng to find a schematic for gear indicator for my gixxer that take signal from speed and rpm signl (plus neutral light for zero) but it seems that it doesn't exist anywhere... do you have any idea?
Kiko said:I don't know why it was not indented...
fxvxca said:i saw that n the code you already put voltage in the program.. in this case i don't have to chet it again?
fxvxca said:sorry but i was typing on a broken keyboard
yes it's correct i have a gsx-r 600 k4 (2004) in case what should i have to use for the measurement?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?