; PIC 16F84a BLINK TEST ; auteur :M.Bareille ;----------------------------------------------------------------- ; ;----------------------------------------------------------------- ; __config 0x3FF9 ;XT oscillator, no WDT, no code protect radix dec #define __16C84 #include #define Bank0 bcf STATUS,RP0 #define Bank1 bsf STATUS,RP0 TEMP0 equ 0x001B ; 2 octet buffers temporaires TEMP1 equ 0x001C ;--------------------------------------------------------------------------------- org 0 goto Initial org 0x05 ;--------------------------------------------------------------------------------- Initial clrf PORTA ; raz ports A et B clrf PORTB ; Bank1 ; bcf INTCON,GIE ; pas d'ITs clrf TRISB ; B en OUT clrf TRISA ; port A out bsf TRISA,2 ; sauf RA2 cfg en IN Bank0 ; ; ---------------- raz var global bsf PORTA,3 ; allume la led ;--------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------- Depart call Pause bcf PORTA,3 call Pause bsf PORTA,3 goto Depart Pause movlw 255 movwf TEMP1 loop1 movlw 255 movwf TEMP0 looP nop nop nop nop nop nop nop nop nop nop nop decfsz TEMP0 goto looP decfsz TEMP1 goto loop1 return ;;--------------------------------------------------------------------------------- PortBInput Bank1 movlw 0x01 ; RB0 en IN only... movwf TRISB Bank0 return PortBOutput Bank1 clrf TRISB Bank0 return ;--------------------------------------------------------------------------------- end