I have updated my Website with version 0.83 of the emulator.
The debugger can now handle up to 10 breakpoints. SPI is supported and has been tested with an SPI EEPROM, SIPO and PISO shifters. Virtual DMA has been added improving data transfer speed for SPI and I2C. As DMA is virtual (done by the ATMega in the foreground) the emulated CPU is halted during a DMA transfer. However, DMA can be interrupted by a 6502 IRQ or NMI request between each byte transferred and will resume to transfer the remaining bytes when the interrupt service exits with an RTI.
I measured the DMA speed increase from programmed IO to DMA with 4k blocks of data:
Code:
SPI @ 8MHz 4µs timer count µs/4KiB kB/s
read device pio 2A2C 43184 94,8
write device pio 290F 42044 97,4
read device dma 0A86 10776 380,1
write device dma 0A06 10264 399,1
I²C @ 400kHz 64µs timer count µs/4KiB kB/s
read device pio 08D4 144640 28,3
read device dma 06B8 110080 37,2
Of course, the theoretical bandwidth of an 8 MHz SPI is 1MB/s, but the SPI bus is shared with the RAM address bus and the emulator must switch between both to store or fetch each byte. The I2C DMA at 400kHz is close to its theoretical maximum of 44.4 kB/s, but as expected the gain over programmed IO is not as impressive as for SPI.
The updated hardware and debugger documents have been merged into a single reference manual. Chapters on how to configure the ATMega source and how to use IO-registers have been added.
Because I have SPI now, the next step is to test SD-cards. A special partition on the SD-card will become another option to store binary program images as with the currently available optional serial EEPROMs.