Tarea 10: Nelson Carreño
Tarea 10: Nelson Carreño
Tarea 10: Nelson Carreño
errorlevel -302
main
;SETEO DE PUERTOS
banksel ANSEL
clrf ANSEL
clrf ANSELH
banksel TRISB
clrf TRISB
clrf PORTB
clrf ADDRESS
clrf counter1
clrf counter2
movlw 0x55 ;DIRECCION 251 DE EEPROM
movwf ADDRESS
loop
bsf STATUS,RP1 ;
bcf STATUS,RP0 ; Acceder al banco 2
movf ADDRESS,W ; Mover la direccin al registro W
movwf EEADR ; Escribir la direccin
bsf STATUS,RP0 ; Acceder al banco 3
bcf EECON1,EEPGD ; Seleccionar la EEPROM
bsf EECON1,RD ; Leer los datos
bcf STATUS,RP0 ; Acceder al banco 2
Nelson Carreo
movf EEDATA,W ; Dato se almacena en el registro W
banksel PORTB
movwf PORTB
call DELAY
incfsz ADDRESS,F
goto loop
DELAY
clrf counter2 ; Clears variable "counter2"
loop1
clrf counter1 ; Clears variable "counter1"
loop2
decfsz counter1 ; Decrements variable "counter1" by 1
goto loop2 ; Result is not 0. Go to label loop2
decfsz counter2 ; Decrements variable "counter2" by 1
goto loop1 ; Result is not 0. Go to lab loop1
return
Nelson Carreo