koolguy
Active Member
Hi again,
I was reading data sheet and want to learn Timer0 in assembly so, i have confusion as the interrupt addr is 0x04 so, how to set for external clock...here is the code which need help.
The aim of code is to change the output high when timer is overflow..
I was reading data sheet and want to learn Timer0 in assembly so, i have confusion as the interrupt addr is 0x04 so, how to set for external clock...here is the code which need help.
The aim of code is to change the output high when timer is overflow..
Code:
LIST p=16f72
#include "p16f72.inc"
__config b'00000000011111'
org 0x00
bsf STATUS,RP0 ; bank 1
movlw b'01000000' ;internal inst cycle showing error at option?
; movwf OPTION
bcf STATUS,RP0; bank 0
movlw b'10100100'
movwf INTCON; enable interrupt
bsf STATUS,RP0 ; bank 1
movlw 0x00
movwf TRISB; output direction
bcf STATUS,RP0
loop
movlw 0x00
movwf PORTB
goto loop
org 0x04
goto loop
retlw 0x00
end