teste
;*******************************************
;Autor: Garrotti
;Data: 03/12/2008
;Versao: 0
;Objetivo:
; piscar leds com tempo por software
;*******************************************
;----definicao do microcontrolador----------
#include
;----------Configuracao:-------------------
;escrever em uma única linha __CONFIG _XT_OSC&_CP_OFF&_WDT_OFF&_PWRTE_ON&_LVP_OFF&_CPD_OFF&_DEBUG_OFF
;----------------------------------
;--definicao das variaveis de RAM--- CBLOCK 0x20 TEMP1 TEMP2 TEMP3 TEMP4 TEMP5 REG1 FLAG1 ENDC
;----DEFINICAO DAS CONSTANTES----------
#DEFINE XVALOR 0XFF
;----------------------------------
ORG 0x0000 GOTO CONFIGURA
;----------------------------------
ORG 0x0004 RETFIE
;---------------------------------
;-------funcoes-------------------
DELAY_1MS
MOVLW .250 MOVWF TEMP1
LD1
NOP DECFSZ TEMP1,F GOTO LD1 RETURN
;--------------------------------
DELAY_XMS MOVWF TEMP2
LD2
CALL DELAY_1MS DECFSZ TEMP2,F GOTO LD2 RETURN
;-------------------------------
DELAY_250MS MOVLW .250 MOVWF TEMP3
LD3
CALL DELAY_1MS DECFSZ TEMP3,F GOTO LD3 RETURN
;-------------------------------
DELAY_1S MOVLW .4 MOVWF TEMP4
LD4
CALL DELAY_250MS DECFSZ TEMP4,F GOTO LD4 RETURN
;-------------------------------
DELAY_XS MOVWF TEMP5
LD5
CALL DELAY_1S DECFSZ TEMP5,F GOTO LD5 RETURN
;----------------------------
CONFIGURA
;-----seleciona banco 0--------- BCF STATUS,RP1 BCF STATUS,RP0
;----limpa ports de saida--------- CLRF PORTA CLRF PORTB CLRF PORTC CLRF PORTD CLRF PORTE
;-------programa os ports como saida------- BSF STATUS,RP0 MOVLW B'00011111' MOVWF TRISA MOVLW B'11111111' MOVWF TRISB MOVWF TRISC MOVLW B'00000000' MOVWF TRISD MOVLW B'00000111' MOVWF TRISE
;-----desabilita interrupcoes---- MOVLW B'00000000' MOVWF INTCON
;------programa porta como