Microprocessor light-emitting diode tachometer of AZLK

10/16/2007 - 20:39

Replacement to a regular tachometer, displays a being shone column from 80 light-emitting diodes

Displays a being shone column on a scale of light-emitting diodes, the Description of all dashboard in which the tachometer described below is established works from KSZ on BONDS, to look in article the AZLK Dashboard .

The circuit works with contact system of ignition on BONDS. Whether will correctly work with other engines, I can not promise.

A microprocessor light-emitting diode tachometer of AZLK

The matter is that in an entrance chain there are no special elements for elimination of a tinkling sound of contacts, the tinkling sound is filtered programmno. The program considers that passed the forward front of an impulse if the high signal on an entrance keeps not less set time. This delay stole up a method scientific тыка. At reduction of a delay of the indication become overestimated because of calculation of fronts from a tinkling sound, at increase in a delay on big frequency there are admissions in calculation of regular impulses.

As a result the program which steadily works turned out and gives the evidences coinciding with indications of a tachometer from a priborka of RAR in дипазоне of 500-5500 rpm. But there is no guarantee that this circuit will work with other engines, or with other type of system of ignition since to prove the chosen size of a delay I cannot than, except the carried-out tests.

Light-emitting diodes are connected to exits of Out1-Out15 of type "an open collector". It allowed запитать diodes from 12В with consecutive inclusion on 4 diodes. Chips of MBI equalize a current (and thus brightness of a luminescence) at consecutive inclusion of several light-emitting diodes in an incomplete chain. Such inclusion also reduces a consumed current.

The tachometer is connected to standard conclusions of a plait of conducting for connection of a regular tachometer.

Range of measurement of 0-8000 rpm with a step of 100 rpm.


It is possible to copy the text between lines - in a text editor, NOTEPAD will approach, and to save the file with the HEX expansion. Such file can be used for a microprocessor insertion.



Further the initial text of the program for those who can and will conceive something to correct.

; tachometer
 list p=16F84A
 __ config _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC

; Constants
bitSDI	equ	3
bitCLK	equ	2
bitLAT	equ	1
iniRPT equ 5
iniTMR equ d '022'; d '100'
iniDBL equ d '032'

; Variables
cntIMP	equ	0x0C	; counter of impulses
cntRPT	equ	0x0D	; counter of repetitions
cntDBL equ 0x0E; counter of time of a tinkling sound of contacts

; program
	org		0x000
	clrf	PORTA
	clrf	PORTB
	clrf	INTCON
	clrf	TMR0

	bsf		STATUS, RP0
	movlw	b'00000000'; all bits of RA on a conclusion
	movwf	PORTA
	movlw	b '00000001'; RB0 on input, other bits of port on a conclusion
	movwf	PORTB		; we switch off tightening resistors,
	movlw b '11000111'	; TMR0 on an internal step with a predivider 256
	movwf		; interruptions are forbidden OPTION_REG, we will check tags
		bcf		STATUS, RP0

; prologue
; to include all scale

        call SendCLR
        movlw d '20'
        movwf cntRPT
        call SendQRT
        decfsz cntRPT, f
        goto loopPRE1
        call SendLAT      
        ; to wait 1 with = for 16 tics (1 tic = 64К microsec = 65 ms)
        movlw d '16'
        movwf cntRPT
        btfss	INTCON, T0IF
        goto loopPRE2
        bcf	INTCON, T0IF
        decfsz cntRPT, f
        goto loopPRE2  
        ; to switch off
        call SendCLR
        call SendLAT

; global cycle		
        call COUNT_IMP
        call SHOW_COUNT
        goto Main_loop

COUNT_IMP; measurement phase

	clrf	cntIMP	; we null the through counter
        movlw iniDBL
        movwf cntDBL; we initialize the counter of blocking of a tinkling sound
        movlw iniRPT
	movwf	cntRPT; cycle of calculation of impulses 
			    ; (5 times counting by the timer on 60мс)
	movlw	iniTMR; at 4Мгц and a predivider 1:256 
			    ; 1 tic of the timer of 256 microsec turns out
	movwf	TMR0; TMR0 should count from 22 
			    ; to 256 during 59,904 ms
	btfss	INTCON, INTF; if there was a front of an impulse of the sensor,
			    ; that we go on processing of counters
	goto	NoINCR	; the sensor is silent, we go to check the timer
        btfss PORTB, 0
        goto ClrINT; if RB0=0, we dump interruption
                            ; if RB0=1,
        decfsz cntDBL, f; we detain further actions
        goto NoINCR; before zeroing of the counter of a tinkling sound
     			    ; the delay for the period of a tinkling sound ended
        incf cntIMP, f; +1 in a schechik of impulses
        bcf	INTCON, INTF; dumped a flag of external interruption
        movlw iniDBL
        movwf cntDBL; we initialize the counter of blocking of a tinkling sound
        btfss	INTCON, T0IF; we repeat a small cycle,
	goto	ms60	; while TMR0 will not tell: will suffice!
	decfsz	cntRPT, f; counted 60 ms, it is necessary to repeat 5 times, 
	goto	ms300	; that an interval of counting turned out 0,3 seconds
        ; counted 300 ms
        rrf cntIMP, f; we halve the counted number of impulses
        bcf cntIMP, 7

SHOW_COUNT; phase of indication of results of measurement
; занулить indicator bits
        call SendCLR
; conclusion of a nepony quartet of a scale
        movfw cntIMP
        andlw 3; a remainder of division on 4
        addlw 1; +1
        movwf cntRPT; in a schechik of repetitions
        bsf PORTB, bitSDI
        goto loopMOD+2; to enter into a cycle from counter check 
        call SendCLK
        bcf PORTB, bitSDI
        decfsz cntRPT, f
        goto loopMOD        
; conclusion of full quartets of a scale
        rrf cntIMP, f
        bcf cntIMP, 7
        rrf cntIMP, f
        bcf cntIMP, 7; integer division 
			      ; on 4 counters of impulses
        incf cntIMP, f; gives number of full quartets of a scale
        goto loopDIV+1; to enter into a cycle from counter check
        call SendQRT
        decfsz cntIMP, f
        goto loopDIV 
; switching on indication of new measurement
        call SendLAT 

; subprogrammes

SendCLK; formation of a clock impulse of CLOCK
	bsf		PORTB, bitCLK	
	bcf		PORTB, bitCLK

SendLAT; conclusion of an impulse of a latch of LATCH
	bsf		PORTB, bitLAT
	bcf		PORTB, bitLAT

SendQRT; conclusion of a full quartet
        bsf PORTB, bitSDI; for each full quartet we deduce 1000
        call SendCLK
        bcf PORTB, bitSDI
        call SendCLK
        call SendCLK
        call SendCLK

SendCLR; to clear a scale
        bcf PORTB, bitSDI
        movlw d '80'
        movwf cntRPT
        call SendCLK
        decfsz cntRPT, f
        goto loopCLR

http://www.club.azlk.ru source

Microprocessor light-emitting diode tachometer of AZLK