Advertisement
Guest User

TP1 - Clignotement incrémentation

a guest
Oct 30th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <p18F4550.inc>
  2. CONFIG WDT = OFF ; disablewatchdogtimer
  3. CONFIG MCLRE = ON ; MCLEAR Pin on
  4. CONFIG DEBUG = OFF ; DisableDebugMode
  5. CONFIG FOSC = HS
  6.  
  7. RES_VECT CODE 0x0000 ; processor reset vector
  8.     goto prog_start
  9.    
  10. MAIN_PROG CODE ; let linker place main program
  11.  
  12. prog_start
  13.   clrf TRISC ; set PORTC as out
  14.   clrf PORTC ; clear PORTC
  15.   count1  equ H'00'  ;  count1  address
  16.   count2  equ H'01'  ;  count2  address
  17.   goto MAIN_LOOP
  18.  
  19. MAIN_LOOP
  20.     incf PORTC ;incrementation du PORTC
  21.     call my_delay ; Wait
  22.     goto MAIN_LOOP
  23.  
  24. my_delay
  25.     decfsz count2
  26.     goto my_delay
  27.     decfsz count1
  28.     goto my_delay
  29.     return
  30.  
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement