Alright, so to update everyone to the current status of the board
Here is a full picture of the Schematic:
and technically it's also a full list of all components, but i'll do that extra, with datasheets:
U0:
WDC65C02 (CPU)
U1/2:
GAL22V10D (Glue Logic, the Schematic says ATF22V10C but i did use the GAL22V10D on the actual board)
U3:
SN74HC541N (used for the Status Byte of the FT240X)
U4:
FT240XS
U5:
SST39SF040 (512kB FLASH, 8kB used)
U6/7:
IDT71256SA12 (32kB SRAM)
U8:
DS1813-10+T&R (that Reset Circuit thingy, not sure what else to call it)
Here the download for the KiCad Files in case that can also be helpful:
DROPBOX
and Here all the tools i currently have available to me:
* a Logic Probe
* An Arduino i use to control the clock and read out the Address and Data Bus per half clock cycle
also the code i'm currently running on it:
Code: Select all
INIT:
LDX #0xFF
TXS
LDA #0x00
TAX
TAY
START:
.LOOP:
LDA #0b00000010
.WAIT_RX: ; Loops until there is data available in the FIFO
LDX #0x1F
.DELAY_RX: ; Do Nothing for a while
DEX
BNE .DELAY_RX
BIT STT
BNE .WAIT_RX
LDA INP ; Reads a Byte from the FT240X
PHA
LDA #0b00000001
.WAIT_TX: ; Loops until there is space in the FIFO to write data into
LDX #0x1F
.DELAY_TX: ; Do Nothing for a while
DEX
BNE .DELAY_TX
BIT STT
BNE .WAIT_TX
PLA
STA OUT ; Sends the red byte back into the FT240X
BRA .LOOP
STP
The actual problem i'm having at the time:
the "WAIT_RX" loop is supposed to exit only when there was data recieved by the FIFO.
The loop just repeatedly checks bit 1 of the Status Byte (STT), which is the RXF# pin of the FT240X.
if the bit is "0" it means there is data in the FIFO that can be read by the CPU, and that also makes the loop end.
Problem is that the loop ends without that bit ever being set to 0.
What i checked:
I first used my Logic Probe to see if the FT240X had some kind of quirk that would randomly pull the RXF# line low, but the Logic probe didn't show anything strange.
the pin stayed high until i send something via a Terminal Program.
Then i made a second program that just reads out the Status Byte and sends it directly over the FIFO to my PC so i can check if it is reading the Byte correctly.
Code: Select all
START:
.LOOP:
LDA STT
STA OUT
BRA .LOOP
STP
Note that the upper 6 bits are floating, so by default they are always 1, i will show them as "x" in binary.
what i expected was just a continuous stream of "0xFE" (xxxxxx10),
but what i got is strange. mostly it was "0xFE" as expected but at random it would also output "0xFC" (xxxxxx00)
I assume this is why it was escaping the loop, it would randomly just read this sort of "glitched" value that makes it seem like there is data present.
After that i hooked up my Arduino to slowly step through the program to see exactly what is happening, and the problem didn't occour.
Overall this makes me think of 2 possiblities:
1. something strange with the FT240X, i doubt it since the datasheet doesn't mention anything about random signals and it wouldn't make any sense to be honest
2. something with the 3 State buffer i use to read the bits. (SN74HC541N)
I think this is everything?