.nolist ;quartz assumption 4Mhz
.include "ATxmega128A3def.inc"
.list
.ESEG ; EEPROM memory segment
.DSEG ; SRAM memory.segment
.ORG 0x200
RAMTAB: .BYTE 256 ; Destination table (xlengthx bytes).
.CSEG ; CODE Program memory. Remember that it is "word" address space
.org 0x100
rjmp RESET
reti
reti
Delay:
ldi r16, 0x00
ldi r17, 0x00
ldi r18, 0xeb
del_0:
inc r16
brne del_0
inc r17
brne del_0
inc r18
brne del_0
ldi R21, 0xff
out PORTE, R21
ret
Reset:
ldi r16, high(RAMEND); Main program start
out SPH,r16 ; Set stack pointer to top of RAM
ldi r16, low(RAMEND)
out SPL,r16
cli ; Disable all interrupts ;
; place here code related to initialization of ports and interrupts
ldi r16, 0xff
out DDRE, r16
ldi r16, 0xff
out PORTE, r16
ldi r16, 0x00
out DDRF, r16
ldi r16, 0xff
out PORTF, r16
; End of port initialization
;sei Enable interrupts ;
; Main program code place here
Main0:
cbi PORTE, 0
rcall Delay
cbi PORTE, 1
rcall Delay
cbi PORTE, 2
rcall Delay
cbi PORTE, 3
rcall Delay
cbi PORTE, 4
rcall Delay
cbi PORTE, 5
rcall Delay
cbi PORTE, 6
rcall Delay
cbi PORTE, 7
rcall Delay
rjmp Main0
End:
rjmp END
; place here test values
; Test with value 0x8000 also
;
; ROMTAB: .db 0x01, 0x00 , 0xffff
.EXIT
Wyszukiwarka
Podobne podstrony:
kod[waz ze zmiana asm]kod[waz easy]kod[waz przerwania]kod z WOŚP polecane chomiki by closer9KOD RAMKI 16KOD RAMKI 69KOD RAMKI 72kod atrakcyjnoscikod do czcionek i obrazkamb kod usterki P1403The Serpent And The Rainbow Wąż i Tęcza 1988mod KODpierw asmwięcej podobnych podstron