Started working on COM module.

This commit is contained in:
Martin Preuss
2023-01-17 20:56:18 +01:00
parent db7fd9e333
commit 4eb9dd8777
2 changed files with 265 additions and 1 deletions

View File

@@ -4,6 +4,30 @@
; ***************************************************************************
; defines
; ---------------------------------------------------------------------------
; COM module
.equ COM_DDR_DATA DDRA
.equ COM_PORT_DATA PORTA
.equ COM_PIN_DATA PINA
.equ COM_PINMASK_DATA (1<<PORTA1)
.equ COM_PINNUM_DATA PORTA1
.equ COM_DDR_ATTN DDRA
.equ COM_PORT_ATTN PORTA
.equ COM_PIN_ATTN PINA
.equ COM_PINMASK_ATTN (1<<PORTA7)
.equ COM_PINNUM_ATTN PORTA7
.equ COM_IRQ_ADDR_ATTN PCMSK0
.equ COM_IRQ_MASK_ATTN (1<<7) ; bit 7 in PCMSK0
.equ COM_IRQ_GIFR_ATTN (1 << PCIF0)
; ***************************************************************************
; code segment
@@ -36,8 +60,10 @@
; ***************************************************************************
; includes
.include "ringbuffer.asm"
.include "timer.asm"
.include "led.asm"
.include "com.asm"
.include "utils.asm"
@@ -48,6 +74,7 @@
.dseg
ledA3Sram: .byte LED_SRAM_SIZE
wanA7A1Sram: .byte COM_SRAM_SIZE
@@ -57,7 +84,10 @@ ledA3Sram: .byte LED_SRAM_SIZE
.cseg
ledA3Flash: .db DDRA+0x20, PORTA+0x20, PINA+0x20, (1<<PORTA3)
comA7A1Flash: .db 1, 0 ; id, flags
.db DDRA+0x20, PORTA+0x20, PINA+0x20, (1<<PORTA1) ; port info for DATA line
.db DDRA+0x20, PORTA+0x20, PINA+0x20, (1<<PORTA7) ; port info for ATTN line
.db 0, 0x80 ; ATTN: PCINT irq type, irq mask (e.g. for PCMSK0)
blinkPattern: .db 5, 5, 5, 5, 5, 10, 0xff, 0xff ; 3 short blinks, 1s pause, restart