Speedo - Pour les petits genies en electronique

Exclusivement réservé aux questions techniques et mécaniques concernant les SV650 & SV1000 N/S.
Nous vous répondrons au mieux de nos connaissances...
Répondre
sherlock
Pilote 50 cm3
Pilote 50 cm3
Messages : 66
Enregistré le : lun. 09 avr., 2007 21:17
Localisation : Paris

Message par sherlock »

Xavifrench a écrit :Si il n'est pas compilé, oui, on pourra changer la valeur. Mais si il est compilé, là par contre... je me vois pas le reverse-engeneerer pour changer les valeurs en assembleur... :? J'ai une vie sociale :mrgreen:
pas de problème, j'ai deja fait la modif sur une version txt et je peux convertir le programme en hex, asm ou txt si besoin
Avatar du membre
guisv1000s
Pilote 125 cm3
Pilote 125 cm3
Messages : 340
Enregistré le : jeu. 28 juin, 2007 17:54
Moto : sv1000s edition limité
Localisation : Longuyon (54)

Message par guisv1000s »

:shock: :shock: :shock:

Euh juste comme ca j'ai aussi un 1000 mais est ce ke votre appareil me servirait a kelke chose si j'ai pas changé de pignon??? j'ai pas vraiment compris en faite ?? kelkun pourrait m'expliquer ??

laisser tomber jvien de voir sur lotre lien plus haut, j'ai compris !!! :lol:

en faite ca ne me servira pas !!
Modifié en dernier par guisv1000s le jeu. 27 mars, 2008 21:36, modifié 2 fois.
sherlock
Pilote 50 cm3
Pilote 50 cm3
Messages : 66
Enregistré le : lun. 09 avr., 2007 21:17
Localisation : Paris

Message par sherlock »

Xavifrench a écrit : Heu... c'est sûr mais la finition n'est pas la même et à ces fréquences ? Bah moi je préfère de la bonne résine d'epoxy :mrgreen:

C'est quoi les composants qu'il faut en plus pour le 12F683 ? Car le 615 je le trouve mais que sur commande...
bah justement sur la premiere photo, c'est de la résine epoxy dessus ! :?:

Et j'ai pas gardé le shéma pour le 12F683 parce qu'il était baucoup plus encombrant pour le même résultat au final.

Par contre, vu l'endroi ou t'habites tu dois bien connaitre le magasin auquel j'ai pas trouvé le temps d'aller depuis 6 mois !
sherlock
Pilote 50 cm3
Pilote 50 cm3
Messages : 66
Enregistré le : lun. 09 avr., 2007 21:17
Localisation : Paris

Message par sherlock »

guisv1000s a écrit ::shock: :shock: :shock:

Euh juste comme ca j'ai aussi un 1000 mais est ce ke votre appareil me servirait a kelke chose si j'ai pas changé de pignon??? j'ai pas vraiment compris en faite ?? kelkun pourrait m'expliquer ??
La gars qui l'a conçu l'a testé sur SV1000 et Vstrom avec succés, son but avec une correction de 8% était seulement de corriger l'optimisme originel du compteur de ces 2 machines pour obtenir la vitesse réelle. Donc la réponse est oui si tu veux voir la vitesse réelle s'afficher à ton compteur.
Avatar du membre
guisv1000s
Pilote 125 cm3
Pilote 125 cm3
Messages : 340
Enregistré le : jeu. 28 juin, 2007 17:54
Moto : sv1000s edition limité
Localisation : Longuyon (54)

Message par guisv1000s »

sherlock a écrit :
guisv1000s a écrit ::shock: :shock: :shock:

Euh juste comme ca j'ai aussi un 1000 mais est ce ke votre appareil me servirait a kelke chose si j'ai pas changé de pignon??? j'ai pas vraiment compris en faite ?? kelkun pourrait m'expliquer ??
La gars qui l'a conçu l'a testé sur SV1000 et Vstrom avec succés, son but avec une correction de 8% était seulement de corriger l'optimisme originel du compteur de ces 2 machines pour obtenir la vitesse réelle. Donc la réponse est oui si tu veux voir la vitesse réelle s'afficher à ton compteur.
A ben si ca sert ossi sans changer de pignon ca m'interesse !!!! jvé suivre ce topic moi !!!
Avatar du membre
Xavifrench
Pilote 125 cm3
Pilote 125 cm3
Messages : 305
Enregistré le : dim. 09 sept., 2007 16:21
Moto : Honda CBR 1000 RR K6
Localisation : Courbevoie, parc de Bécon

Message par Xavifrench »

sherlock a écrit :
Xavifrench a écrit :Si il n'est pas compilé, oui, on pourra changer la valeur. Mais si il est compilé, là par contre... je me vois pas le reverse-engeneerer pour changer les valeurs en assembleur... :? J'ai une vie sociale :mrgreen:
pas de problème, j'ai deja fait la modif sur une version txt et je peux convertir le programme en hex, asm ou txt si besoin
Cool. Il est complexe le prog ? Bon, si on isole le tout à l'époxy, si les soudures sont pas faites à la volée, ça devrait fonctionner longtemps :mrgreen: Mais il reste ce souci de régulation de courant et donc de température... a tester donc en conditions extrêmes (plein été, montage placé vers le moteur :twisted: )
Image
Avatar du membre
equi
Pilote Supersport
Pilote Supersport
Messages : 2376
Enregistré le : mar. 17 avr., 2007 21:36
Moto : hein ? quoi ?
Localisation : Wittelsheim

Message par equi »

voici le prog :
12HV_Speedo_Corrector

8% correction for speedometer

;12HV619 Speedometer correction for DL1000
;GP4 (Pin 3) is pulse out to speedo (TMR0)
;GP2 (Pin 5) is pulse in from sender, weak pullup enabled (GP2->TMR1)
;GP5 (pin 2) is test pulse out (TMR1)
;+5 volt Pin 1 Vdd
;Ground Pin 8 Vss
;internal 8Mhz oscillator
;TMR1 16 bit counter is half period time, triggered on GP2 edge interupt !:1 prescaler
;TMR0 8 bit counter is half period time out 1:1 prescaler
;TMR2 8 bit test frequency output ~100 km/hr
;if speed is < ~11 kph no correction is done (overflow on TMR1)
;
;Max Speed of ~ 226 KPH (145 MPH) = 300 Hz (3.3 msec period)
;Min Speed of ~ 11.5 KPH (7 MPH) = 15.26Hz (65.5 msec period)
;pulse period = 1/(km/hr * 1.3265)seconds
;
; John Snider April 2007
;
PROCESSOR 12F683
#include <p12f683.inc> ; processor specific variable definitions
;code protect off, watch dog timer off, power up timer enable, master clear off, internal osc with IO
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _INTOSCIO
__idlocs H'1259'

;***** VARIABLE DEFINITIONS
CBLOCK 0x40
w_temp ; variable used for PUSH/POP
status_temp ; variable used for PUSH/POP

;TMR0 variables
TMR0_hi ;high byte
;TMR0 ;low byte is timer

;TMR2 sweep variable
TMR2_hi
TMR2_Sweep_Lo
TMR2_Sweep_Hi

OverFlow_Flag ;TMR1 overflow flag

Out_Low ;desired period, low byte
Out_High ;desired period, high byte

In_Period_High ;input period high
In_Period_Low

ACC0
ACC1
ACC2

TEMP0
TEMP1

ENDC
;
;**********************************************************************
ORG 0x0000 ; processor reset vector
goto main ; go to beginning of program
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Interrupt Service Routine
ORG 0x0004 ; interrupt vector location
PUSH movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
;
btfsc INTCON, T0IF ;Timer 0 int?
goto TMR0_Int
;
btfsc PIR1,TMR1IF ; Timer1 int?
goto TMR1_Int

btfsc PIR1,TMR2IF ; Timer1 int?
goto TMR2_Int

btfsc INTCON, INTE ;ext GP2 int
goto GP2_Int
goto POP ;not TMR0/TMR1/TMR2/GP2 int
;
;--------------------------------------------------------
TMR0_Int ;entered every 256 Tosc (1:1 prescaler)
decfsz TMR0_hi,f
goto Tmr0_exit ; high byte not zero.
movf Out_High,w ; get high byte value
movwf TMR0_hi ; load in high byte
incf TMR0_hi,f ; allow for decrement done before loop
movf Out_Low,w ; new lsb value
movwf TMR0
;toggle the output bit
movlw b'00010000'
xorwf GPIO,f
Tmr0_exit
bcf INTCON,T0IF ;clear the int
goto POP
;----------------------------------------------------
TMR1_Int ;entered every 256*256 Tosc (1:1 prescaler)
;no GP2 in 256 * 256 * 0.5usecs causes TMR1 to overflow
;toggle on GP2
bsf OverFlow_Flag, 0
bcf INTCON, T0IE ;turn off TMR0 int
bcf PIR1, TMR1IF ;clear tmr1 int flag
goto POP
;----------------------------------------------------
GP2_Int ;entered on rising / falling edge of GP2
btfsc OverFlow_Flag, 0
goto Slow_Speed
bcf T1CON, TMR1ON ;turn timer off
;store the measured period
movf TMR1L,w
movwf In_Period_Low
movf TMR1H,w
movwf In_Period_High
Restart_Timer
;restart the timer
clrf TMR1H
clrf TMR1L
bsf T1CON, TMR1ON ;turn timer back on
bsf STATUS, RP0 ;Bank 1
;81h OPTION_REG: NOT_GPPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
movlw b'01000000'
xorwf OPTION_REG,f ;toggle rising / falling edge
bcf STATUS,RP0 ;Bank 0
;
bsf INTCON, T0IE ;turn on TMR0 if TMR1 turned it off
bcf INTCON, INTF ;clear GP2 int flag
goto POP
Slow_Speed
;toggle the output bit
movlw b'00010000'
xorwf GPIO,f
;reset the overflow flag
bcf OverFlow_Flag,0
goto Restart_Timer
;---------------------------------------------------
TMR2_Int ;entered every 256 Tosc
decfsz TMR2_hi,f
goto Tmr2_Exit ; high byte not zero.
movf TMR2_Sweep_Hi,w
movwf TMR2_hi ;reload high byte
movf TMR2_Sweep_Lo,w
movwf TMR2 ;reload low byte
;toggle the output bit pin 2 GP5
movlw b'00100000'
xorwf GPIO,f
Tmr2_Exit
bcf PIR1, TMR2IF ;clear tmr1 int flag
goto POP
;---------------------------------------------------
POP movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f ; swap nibbles in w_temp
swapf w_temp,w ; restore w by re-swapping nibbles in w_temp into w
retfie ; return from interrupt, sets GIE
;-------------------------------------------------
main
;
;set oscillator to 8MHz internal x111xxx1
banksel OSCCON ;bank 1
movlw b'01110001' ;
movwf OSCCON ;8-mhz INTOSC system clock
STABLE btfss OSCCON,HTS ;oscillator stable?
goto STABLE ;no, branch
bcf STATUS,RP0 ;bank 0

;init Timer0
CLRWDT ;Clear WDT
CLRF TMR0 ;Clear TMR0
;set pre-scaler to WDT
BANKSEL OPTION_REG ;bank 1
MOVLW b'00001000' ;Set PSA=1 - prescaler to WDT
MOVWF OPTION_REG ;
CLRWDT ;
BCF STATUS,RP0 ;Bank 0

;initialization of IO Pins
banksel CMCON0
clrf CMCON0 ;turn comparators off
;GPIO_2/pin 5 is GP2 external int on rising edge/speedo in
;GPIO_4/pin 3 is speedo out
;ICSP on other pins
banksel TRISIO
MOVLW b'00000100' ;1=input, 0=output GP2 input
MOVWF TRISIO ;set pin registers

;set weak pullup on GP2 input
;95h WPU: — — WPU5 WPU4 — WPU2 WPU1 WPU0
banksel WPU
movlw b'00000100'
movwf WPU

;turn off A/D converter
banksel ADCON0
clrf ADCON0
;set ANSEL to digital
banksel ANSEL
clrf ANSEL

;init Timer 1
;TMR1H / TMR1L unchanged on WDT reset, unknown on power up
banksel TMR1H
clrf TMR1H
clrf TMR1L
banksel PIR1
;0Ch PIR1: EEIF ADIF CCP1IF — CMIF OSFIF TMR2IF TMR1IF
bcf PIR1, TMR1IF ;clear tmr1 int flag
;10h T1CON: T1GINV TMR1GE T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON
banksel T1CON
movlw b'00000100' ;timer1 on, no prescaler
movwf T1CON

;init Timer 2
clrf TMR2 ;init TMR2 value
bcf PIR1, TMR2IF ;clr int flag
;no prescaler x0000, tmr2 on 1, no postscaler 00
movlw b'00000100'
movwf T2CON
clrf TMR2_Sweep_Hi ;clear ramp value
clrf TMR2_Sweep_Lo


;init variables
movlw 0xDF ; set msb value for initial pulse
movwf TMR0_hi ; put in hi
movwf Out_High
clrf Out_Low
;movlw 0xE0 ;17.5 Hz
movlw 0x27 ;100 Hz
movwf TMR2_Sweep_Hi ;initial test freq out
movlw 0x00
movwf TMR2_Sweep_Lo
bsf OverFlow_Flag,0 ;wait for valid pulse

;init interupts
;Timer 1
;8Ch PIE1: EEIE ADIE CCP1IE — CMIE OSFIE TMR2IE TMR1IE
banksel PIE1
movlw b'00000011'
movwf PIE1
;0Bh/8Bh INTCON: GIE PEIE T0IE INTE GPIE T0IF INTF GPIF
banksel INTCON
movlw b'11110000'
movwf INTCON
;-----------------------------------------------------------
;end of initialization

Loop ;program loop
btfsc OverFlow_Flag, 0
goto Loop
;The 16 bit measured interval is In_Period_High/Low = 1/2 period
;Multipy period by 1.08 change

;copy 16 bit timer values
;turn off GP2 int so values don't change during update
bcf PIE1, INTE
movf In_Period_High,w
movwf ACC1
movf In_Period_Low,w
movwf ACC0
bsf PIE1, INTE

; ACC = ACC * 1.08
; Temp = TEMP
; ACC size = 16 bits
; Error = 0.5 %
; Bytes order = little endian
; Round = no

; ALGORITHM:
; Clear accumulator
; Add input * 1 to accumulator
; Add input / 16 to accumulator
; Add input / 64 to accumulator
; Move accumulator to result
;
; Approximated constant: 1.07813, Error: 0.173611 %

; Input: ACC0 .. ACC1, 16 bits
; Output: ACC0 .. ACC2, 17 bits
; Code size: 33 instructions

;copy accumulator to temporary
movf ACC1, w
movwf TEMP1
movf ACC0, w
movwf TEMP0


;shift accumulator right 2 times
clrc
rrf ACC1, f
rrf ACC0, f
clrc
rrf ACC1, f
rrf ACC0, f

;add temporary to accumulator
addwf ACC0, f
movf TEMP1, w
skpnc
incfsz TEMP1, w
addwf ACC1, f

;shift accumulator right 4 times
swapf ACC0, w
andlw 0x0F
movwf ACC0
swapf ACC1, w
movwf ACC1
andlw 0xF0
xorwf ACC1, f
iorwf ACC0, f
skpnc
bsf ACC1, 4

;add temporary to accumulator
movf TEMP0, w
addwf ACC0, f
movf TEMP1, w
skpnc
incfsz TEMP1, w
addwf ACC1, f
clrf ACC2
rlf ACC2, f
;end of percent add
;
;delay TMR0 int during update
bcf INTCON, T0IE
;TMR0 counts up out_low = FF-In_Period_Low
comf ACC0,w
movwf Out_Low
movf ACC1,w
movwf Out_High
bsf INTCON, T0IE; ;enable tmr0
goto Loop
;
end
---------------------------------------------------------------
Avatar du membre
SV6.5
Modérateur
Modérateur
Messages : 16463
Enregistré le : dim. 27 mai, 2007 18:12
Moto : Speedster S20
Localisation : Paris

Message par SV6.5 »

:Hein85: encore un topic interessant mais je comprend rien :mrgreen: .
Tu vois, le monde se divise en deux catégories, ceux qui sont de vrai modos et ceux qu'ils ne le sont pas. Toi t'es pas.
"A choisir je préfère y rester au fond d'un fossé avec ma brêle et mon cuir..."
Kip's signature
Avatar du membre
l'bourrin
Pilote 50 cm3
Pilote 50 cm3
Messages : 112
Enregistré le : ven. 11 mai, 2007 16:27
Moto : SV1000 Brutasse
Localisation : 92 asnieres

Message par l'bourrin »

Bah, moi je suis interessé par ce montage !

j'en prends deux ! un programmé pour le pignon d'origine et un autre pour un pignon de 16 !

c'est possible ?
L'Bourrin
Avatar du membre
Xavifrench
Pilote 125 cm3
Pilote 125 cm3
Messages : 305
Enregistré le : dim. 09 sept., 2007 16:21
Moto : Honda CBR 1000 RR K6
Localisation : Courbevoie, parc de Bécon

Message par Xavifrench »

equi a écrit :voici le prog :
12HV_Speedo_Corrector
8% correction for speedometer

(...)
Je n'ai pas vu où changer le taux d'erreur :( ... ce qui ne m'étonne pas vu que je suis à peine initié au langage ASM :oops: . Bref, il va falloir trouver quelqu'un qui s'y connaisse, ou quelqu'un qui se tappe le cours de bigonoff ( icone grrrrr ) . Sinon, on fait confiance et on implante le programme, tel que nous l'avons. ( icone fumeur joint )
Image
Avatar du membre
bendodu
Pilote Supersport
Pilote Supersport
Messages : 1668
Enregistré le : mer. 30 mai, 2007 15:14
Moto : SV1000S full black
Localisation : Montargis (45)
Contact :

Message par bendodu »

Moi aussi je suis grave interressé mais juste pour un pignon de seize.

Sinon, le vrai speedohealer qu'ils vendent, il a un radiateur ?????
Parceque si non, bah pas besoin d'en coller un.


;Max Speed of ~ 226 KPH (145 MPH) = 300 Hz (3.3 msec period)
;Min Speed of ~ 11.5 KPH (7 MPH) = 15.26Hz (65.5 msec period)
;pulse period = 1/(km/hr * 1.3265)seconds

Euh ça veut dire quoi ça, qu'en dessous de 11,5 km/h et qu'au dessus de 226 km/h le compteur n'indique plus rien ou ça rien a voir. :oops:
Modifié en dernier par bendodu le ven. 28 mars, 2008 11:33, modifié 1 fois.
Avatar du membre
equi
Pilote Supersport
Pilote Supersport
Messages : 2376
Enregistré le : mar. 17 avr., 2007 21:36
Moto : hein ? quoi ?
Localisation : Wittelsheim

Message par equi »

le vrai, je pense pas qu'il a un radiateur, c'est une boiboite fermée.
---------------------------------------------------------------
Avatar du membre
bendodu
Pilote Supersport
Pilote Supersport
Messages : 1668
Enregistré le : mer. 30 mai, 2007 15:14
Moto : SV1000S full black
Localisation : Montargis (45)
Contact :

Message par bendodu »

Faut juste avoir un cable assez long pour aller de la connexion a la selle passager.
Avatar du membre
Xavifrench
Pilote 125 cm3
Pilote 125 cm3
Messages : 305
Enregistré le : dim. 09 sept., 2007 16:21
Moto : Honda CBR 1000 RR K6
Localisation : Courbevoie, parc de Bécon

Message par Xavifrench »

bendodu a écrit :Euh ça veut dire quoi ça, qu'en dessous de 11,5 km/h et qu'au dessus de 226 km/h le compteur n'indique plus rien ou ça rien a voir. :oops:
Aucune idée, il faudrait comprendre l'ASM pour savoir exactement.

En ce qui concerne le radiateur, tant que ça fonctionne sans ! :mrgreen: Quelqu'un saurait-il ce qu'il y a dans le speedo original ?
Image
Avatar du membre
guisv1000s
Pilote 125 cm3
Pilote 125 cm3
Messages : 340
Enregistré le : jeu. 28 juin, 2007 17:54
Moto : sv1000s edition limité
Localisation : Longuyon (54)

Message par guisv1000s »

Ok OK c cool mais ki c'est ki s'occupe de les faire ????
jsuis egalement interresse !! :P
Répondre