Você está na página 1de 2

/************

ESCUELA POLITECNICA NACIONAL


************
SISTEMAS MICROPROCESADOS
************
DEBER 1-II BIMESTRE
* FECHA: 09/12/2014 11:28:51
* NOMBRE: Alexandra Tituaa
*/

************
************
************

.cseg
.org 0x00
.def tempo=R16
.def tempo1=R17
.def aux=r18
.def aux1=r19
;inicializacion de stack pointer
ldi tempo,high(ramend)
out sph,tempo
ldi tempo,low(ramend)
out spl,tempo
;******************declarar puertos*************************
ldi tempo,0b00001111
out ddrc,tempo
ldi tempo,0b01111111
out ddra,tempo
;******************inicializa puertos********************
clr tempo
out portc,tempo
out porta,tempo
;******************pull up*************************
in tempo,mcucr
andi tempo,0b11101111
out mcucr,tempo
;******************inicio principal*************************
clr tempo1
ldi tempo,0b00000001
inicio:
ldi zl,low(tabla*2)
ldi zh,high(tabla*2)
add zl,tempo1
clr aux
adc zh,aux
lpm aux,z
out porta,aux
clr zl
clr zh
out portc,tempo
rol tempo
inc tempo1
rcall retardo
clr aux
out portc,aux
cpi tempo1,5
breq reinicio
rjmp inicio
reinicio:

clr tempo1
ldi tempo,0b00000001
rjmp inicio
;********************Sub Retardo*************************
retardo:
ldi aux,2
retar1:
ldi aux1,255
retar: dec aux1
brne retar
dec aux
brne retar1
ret
tabla:
.db 0b00001100,0b01000000
.db 0b01000111,0b01001111

Você também pode gostar