Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<p18F4550.inc>
- count1 equ H'00' ; count1 address
- count2 equ H'01' ; count2 address
- res_vect code 0x0000 ; processor reset vector
- goto prog_start ; go to the beginning of program
- main_prog code ; let linker place main program
- init
- goto main_loop
- not_pressed
- btfss PORTD , RD0
- goto not_pressed
- goto pressed
- pressed
- btfsc PORTD , RD0
- call main_loop
- goto pressed
- prog_start
- clrf TRISC ; set PORTC as output
- clrf PORTC ; clear PORTC
- goto not_pressed
- ;goto main_loop
- ;goto not_pressed
- main_loop
- bsf PORTC, RC0 ; put RC0 on 1 (LED ON)
- ;incf PORTC
- call my_delay ; wai
- bcf PORTC, RC0 ; put RC0 on 0 (LED OFF)
- ;incf PORTC
- call my_delay ; wait
- goto not_pressed
- my_delay
- decfsz count2
- goto my_delay
- decfsz count1
- goto my_delay
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement