WIP reimplementing video generation with shift register

This commit is contained in:
Daniele Verducci su MatissePenguin 2021-02-09 23:20:26 +01:00
parent e1af852f2e
commit 6cce5209cc
5 changed files with 97 additions and 1369 deletions

View File

@ -2,4 +2,8 @@ pal-adapter:
@echo "Building pal adapter rom..."
@avra main.asm
@echo "Writing to ATMEGA1284..."
@minipro -w main.hex -p ATMEGA1284
@minipro -w main.hex -p ATMEGA1284
fuses:
@echo "Writing fuses.conf..."
@minipro -w fuses.conf -c config -p ATMEGA1284

View File

@ -1,4 +1,12 @@
# Atmega Microcontroller
## Auto build & flash
Use make to build & flash automatically.
The first time the microcontroller is flashed, is needed to flash fuses:
`make fuses`
Then, every time the asm code is changed, it can be built and flashed with:
`make`
## Build ASM code
`avra filename.asm` (generates *filename.hex*)

View File

@ -1,4 +1,4 @@
fuses_lo = 0xAF
fuses_lo = 0xEF
fuses_hi = 0x99
fuses_ext = 0xff
lock_byte = 0xff

View File

@ -4,7 +4,7 @@
; This also displays byte's MSB pixel "for free", as the video pin is PD7 (last bit of PORTA).
;
; INTERFACING WITH PAT80:
; Use PortB as data port. Before writing anything, issue a read (pin RW HIGH) and check the busy pin on the data port.
; Use PortB as data port. Before writing anything, issue a read (pin RW HIGH) and check the busy pin on the data port.
; If the busy pin is high, retry reading until goes low. When the busy pin goes low, we have... TODO
;
; ELECTRONICALLY:
@ -45,17 +45,18 @@
.def HIGH_ACCUM = r16 ; an accumulator in high registers to be used outside of interrupts
; define constant
.equ VIDEO_PORT_OUT = PORTA ; Used all PORTA, but connected only PA0
.equ VIDEO_PORT_OUT = PORTA ; PORTA is connected to a parallel-in serial-out shift register
.equ SYNC_PIN = PC0 ; Sync pin (pin 22)
.equ DEBUG_PIN = PC1 ; DEBUG: Single vertical sync pulse to trigger oscilloscope (pin 23)
.equ DATA_PORT_IN = PINB
.equ CLK_PIN = PD0
.equ RS_PIN = PD1
.equ BUSY_PIN = PD2
.equ SR_LD_PIN = PC2 ; LD pin of shift register (active low)
.equ DATA_PORT_IN = PIND
.equ CLK_PIN = PC3
.equ RS_PIN = PC4
.equ BUSY_PIN = PC5
; memory
.equ FRAMEBUFFER = 0x0100
.equ FRAMEBUFFER_END = 0x3EC0
.equ FRAMEBUFFER_END = 0x3D00 ; 15kb @ 512x240
; start vector
.org 0x0000