Posted: Wed Mar 28, 2012 8:37 pm
First part of "speckle bug" is fixed, but I noticed still an occasional bad pixel. Still an improvement compared to the ~100 bad pixels I got before. Thinking it maybe was related to refresh cycles interfering with data cycles I disabled refresh. This made the problem worse.
I'm pretty sure it's a read-write bus turnaround issue, where pipelined read data from the SDRAM is driven on the data bus at the same time the FPGA is trying to write. I'll need to add an extra idle cycle when a write is interrupting a read. Update: Yes! After adding an extra cycle when switching from read to write, I don't see any more errors. At the same time, I removed an idle cycle when switching from write to read, which does not need a delay.
Here's a picture of the result so far. The black bar is the area that the 6502 can access right now (between $2000 and $B000 on the bus). Inside the black bar are a few random purple pixels (almost impossible to see on the small image)
I changed display to a 256x200 grayscale mode (8 bits per pixel) and added a banking mechanism so the CPU can access all of the SDRAM. CPU can write Y coordinate to $B020, and then use $A000, X to address that line of video memory. I then wrote a simple test program to copy incoming UART data into SDRAM.
I'm pretty sure it's a read-write bus turnaround issue, where pipelined read data from the SDRAM is driven on the data bus at the same time the FPGA is trying to write. I'll need to add an extra idle cycle when a write is interrupting a read. Update: Yes! After adding an extra cycle when switching from read to write, I don't see any more errors. At the same time, I removed an idle cycle when switching from write to read, which does not need a delay.
Here's a picture of the result so far. The black bar is the area that the 6502 can access right now (between $2000 and $B000 on the bus). Inside the black bar are a few random purple pixels (almost impossible to see on the small image)
6502.org wrote:
Image no longer available: http://ladybug.xs4all.nl/arlet/fpga/speckle.jpg
6502.org wrote:
Image no longer available: http://ladybug.xs4all.nl/arlet/fpga/trui.jpg