Atari XL/XE SD cartridge
Atari XL/XE SD cartridge is a device allowing access (read and write) to FAT32 formatted
SD cards by Atari 8-bit computers.
The cartridge occupies address space $8000..$BFFF
. Read and write operations
are controlled through 8 registers mapped to $D5E8..$D5EF
. Each read/write
operates on SD card sectors <SECTOR_NUM>..<SECTOR_NUM>+<SECTOR_COUNT>-1
and
RAM region $8000+512*<OFFSET>..$8000+512*(<OFFSET>+<SECTOR_COUNT>)-1
.
Additionaly read operation may be performed using single register - read address
is automatically incremented after performing the operation.
$D5E8
:
$D5E9
:
<OFFSET>
; data offset from $8000
; measured in 512-byte blocks$D5EA
:
<SECTOR_COUNT>
; number of 512-byte sectors to read/write$D5EB
:
<SECTOR_NUM>
bits 7..0$D5EC
:
<SECTOR_NUM>
bits 15..8$D5ED
:
<SECTOR_NUM>
bits 23..16$D5EE
:
<SECTOR_NUM>
bits 31..24$D5EF
(write):
<READ_ADDRESS>
- offset from $8000; measured in 512-byte blocks$8000..$9FFF
$A000..$BFFF
$D5EF
(read):
<READ_ADDRESS>
; the
address is automatically incremented by 1 after read
; read 10 consecutive sectors from SD card starting from $00123456
; into buffer RAM starting at $8600 and wait for the
; operation to complete
lda #$56
sta $D5EB
lda #$34
sta $D5EC
lda #$12
sta $D5ED
lda #$00
sta $D5EE
lda #3
sta $D5E9
lda #10
sta $D5EA
lda #1
sta $D5E8
lda #$C0
wait
bit $D5E8
beq wait
bmi error
ok
; fill 7 consecutive sectors on SD card starting from $00987654
; with data in buffer RAM starting at $a000 and wait for the
; operation to complete
lda #$54
sta $D5EB
lda #$76
sta $D5EC
lda #$98
sta $D5ED
lda #$00
sta $D5EE
lda #16
sta $D5E9
lda #7
sta $D5EA
lda #2
sta $D5E8
lda #$C0
wait
bit $D5E8
beq wait
bmi error
ok
Main silicon components:
Connectors:
LED indicators:
Boot algorithm:
$BF00
$D5EB..$D5ED
Main loop:
Execute command received through UART (if any):
echo
UART —> microcontroller 'e'
UART <— microcontroller 'e'
read data from buffer RAM (A
, N
- 16-bit little endian numbers)
UART —> microcontroller 'r'
UART —> microcontroller A
UART —> microcontroller N
UART <— microcontroller buffer_ram[A]
UART <— microcontroller buffer_ram[A+1]
…
UART <— microcontroller buffer_ram[A+N-1]
write data to buffer RAM (A
, N
- 16-bit little endian numbers)
UART —> microcontroller 'w'
UART —> microcontroller A
UART —> microcontroller N
UART —> microcontroller buffer_ram[A]
UART —> microcontroller buffer_ram[A+1]
…
UART —> microcontroller buffer_ram[A+N-1]
UART <— microcontroller 'w'
Execute operation read from register at $D5E8
:
<SECTOR_COUNT>
512-byte sectors starting at sector <SECTOR_NUM>
from SD card into buffer RAM at address `$8000+512*<OFFSET>`
<SECTOR_COUNT>
512-byte sectors from buffer RAMAfter operation is finished set success and error flags in register at
at `$8000+512*<OFFSET>` to SD card starting at sector `<SECTOR_NUM>`
$D5E8
.bootstrap/
- Atari bootstrap sources
cpld/
- MMU design files
pcb/
- PCB design files (gEDA) and gerbers
tools/
- programs to control the microcontroller through UART interface
uc/
- microcontroller firmware sources
video/
- video converter