Change code in .asm

Status
Not open for further replies.
savnik said:
I make the Frequency meter at the page :
https://www.sprut.de/electronic/pic/projekte/frequenz/freq_gh.htm
I want to change the code for the prescaler U664(which is 64:1 to 128:1).

My German's not very good, but I'm presuming this part does the compensation for the prescaler?

Code:
; externen 64:1-Vorteiler kompensieren
	call	Mal2		;  2 : 1
	call	Mal2		;  4 : 1
	call	Mal2		;  8 : 1
	call	Mal2		; 16 : 1
	call	Mal2		; 32 : 1
	call	Mal2		; 64 : 1

In which case, presumably, adding another 'call Mal2' will compensate for a 128:1 prescaler.
 
Thank you
I make this change and will test to see if it work.

; externen 128:1-Vorteiler kompensieren
call Mal2 ; 2 : 1
call Mal2 ; 4 : 1
call Mal2 ; 8 : 1
call Mal2 ; 16 : 1
call Mal2 ; 32 : 1
call Mal2 ; 64 : 1
call Mal2 ;128 : 1
 
One more question about this code
How to change the time , who show the "hallo" at the beginning of program.
I want to show for long time(about 2 sec's)
 
savnik said:
One more question about this code
How to change the time , who show the "hallo" at the beginning of program.
I want to show for long time(about 2 sec's)

The routine that prints 'Hallo' is:


There doesn't appear to be any delay routine after it?, so you just need to add a call to a suitable delay after the end of this code.
 
DelayL equ 0x20 ; delay register LOW byte
DelayM equ 0x21 ; delay register MID byte
DelayH equ 0x22 ; delay register HIGH byte

; --------------------------------
; SUBROUTINE: waste time for 500mS
; --------------------------------
;
Delay500 clrf DelayL ; clear DelayL to 0
clrf DelayM ; clear DelayM to 0
movlw 3h ; set DelayH to 3
movwf DelayH
Wait1 decfsz DelayL ; subtract 1 from DelayL
goto Wait1 ; if not 0, goto Wait1
decfsz DelayM ; subtract 1 from DelayM
goto Wait1 ; if not 0, goto Wait1
decfsz DelayH ; subtract 1 from DelayH
goto Wait1 ; if not 0, goto Wait1
return ; finished the delay

It's right to use this code;
 
TEMP1 EQU 0x0C ;User file (RAM) registers
TEMP2 EQU 0x0D
TEMP3 EQU 0x0E

;-------------------------------- Delays ----------------------------------
;
DELAY MOVLW .5 ;1Sec delay
MOVWF TEMP3
CLRF TEMP2
CLRF TEMP1
DELAY1 DECFSZ TEMP1 ;5 * (256 * (256 * 3)) = 983040uS, appx 1sec
GOTO DELAY1
DECFSZ TEMP2
GOTO DELAY1
DECFSZ TEMP3
GOTO DELAY1
RETLW 0

It's right;
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…