; --------------------------------------------------------------------------------------------- ; PISCA LED NO PORTB<0> ; --------------------------------------------------------------------------------------------- list p=16f628a #include #include "familias.inc" errorlevel -302 __CONFIG _CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT   ; ; UDATA 0x20 R1 RES 1 delay_temp RES 1 CLOCK equ 4000000 ; rstvec CODE 0x0000 goto inicio inth CODE 0x0008 retfie ; MAIN CODE #include "delay_services.inc" inicio movlw 0x07 ; mascara movwf CMCON ; desativa comparadores clrf LATB ; limpa PORTB bsf STATUS,RP0 ; BANK 1 clrf TRISB ; PORTB tudo saida bcf STATUS,RP0 ; BANK 0 clrf R1 ; R1 = b'00000000' pisca movf R1,w ; W = R1 xorlw 0x01 ; W = bit 0 = complemento movwf R1 ; salva o complemento movwf PORTB ; acende/apaga LED movlw .200 ; W = 200 call delay_ms ; espera 200ms goto pisca ; vai inverter o LED END