DISPLAY ON OSCILLOSCOPE
I have created a simple program to generate pulses.
I want to see 1 pulse on GPIO4 and other on GPIO5
But the delay in the loops are getting added and I am not getting the desired result.
Following is my code:
I have not mentioned the variables definition here.
movlw .44 ;on time of pulse #1
movwf M1
movlw .44 ;off time of pulse #1
movwf M2
movlw .160 ;on time of pulse #1
movwf M3
movlw .160 ;off time of pulse #1
movwf M4
goto main
main:
call lowtest,hightest
;decfsz COUNTER,1
;call hightest
goto main
;goto loop1
lowtest:
bsf GPIO,5
call Delay
bcf GPIO,5
call Delay1
return
Delay movf M1,0
movwf COUNTER
nop
decfsz temp,f
goto $-2
decfsz COUNTER,f
goto $-4
retlw 00
Delay1 movf M2,0
movwf COUNTER1
nop
decfsz temp1,f
goto $-2
decfsz COUNTER1,f
goto $-4
retlw 00
;loop1:
hightest:
bsf GPIO,4
call Delay2
bcf GPIO,4
call Delay3
return
Delay2 movf M3,0
movwf COUNTER2
nop
decfsz temp2,f
goto $-2
decfsz COUNTER2,f
goto $-4
retlw 00
Delay3 movf M4,0
movwf COUNTER3
nop
decfsz temp3,f
goto $-2
decfsz COUNTER3,f
goto $-4
retlw 00
end