Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble reading 68681 registers #5

Open
ziggekatten opened this issue Mar 28, 2023 · 6 comments
Open

Having trouble reading 68681 registers #5

ziggekatten opened this issue Mar 28, 2023 · 6 comments

Comments

@ziggekatten
Copy link

Is there something I'm missing when trying to use the mc68681? I have no issue writing to it and get console output, but reading data from the recieve buffer always returns 0xff, and reading CRA and SRA always returns 0x00, and MR1A always returns 0x07.

@John-Titor
Copy link
Owner

Are you using the socket console, or the stdout console (--stdout-console) mode? The latter only supports output, it ignores input.

@ziggekatten
Copy link
Author

I'm using the socket console, running a process with --console server

@John-Titor
Copy link
Owner

John-Titor commented Mar 29, 2023

I would expect this to work; what host are you running on? The console server is very generic Python/socket code, but there's always a possibility of something odd. I've only tested on macOS.

Note that CRA/CRB are write-only; I would expect reading from them to return nothing useful.

Most of the time, SRx.TXRDY/TXEMT should be set (and generally speaking you shouldn't be putting anything in TBx unless TXRDY is set...), so I'd focus on getting to that point first. If you haven't already, you might try turning on tracing (--trace-everything) and look for accesses to SRA.

@ziggekatten
Copy link
Author

ziggekatten commented Apr 1, 2023

Running under Windows (WSL2). Linux (Ubuntu 22.04) does not work (get an write error) but I have yet to troubleshoot that one.

Now, sending stuff from the CPU to the UART is no problem. As soon as I put data in the TBA buffer it's printed at the console. The problem I have is recieving data, and to do that the SRA lowest bit should be 0 if an byte have been recieved and put in the buffer RBA if I have read the datasheet correcly. Nor does the buffer full bit going set when typing in the console.

Screenshot from running my code:
image

As yhou can see, SRA is 0x03 all the time, and for some reason RBA contains 0x07, which is weird. It should be empty.

@ziggekatten
Copy link
Author

Running under Windows (WSL2). Linux (Ubuntu 22.04) does not work (get an write error) but I have yet to troubleshoot that one.

Now, sending stuff from the CPU to the UART is no problem. As soon as I put data in the TBA buffer it's printed at the console. The problem I have is recieving data, and to do that the SRA lowest bit should be 0 if an byte have been recieved and put in the buffer RBA if I have read the datasheet correcly. Nor does the buffer full bit going set when typing in the console.

Screenshot from running my code: image

As yhou can see, SRA is 0x03 all the time, and for some reason RBA contains 0x07, which is weird. It should be empty.

Ohhhh.....sometimes one should just take some time to get the basics right....I'm writing my stuff in C, and missing an * means reading address instead of value of my pointer....jezz..... the figures you see in the screenshot is the last byte of the pointer address, not the value in the register....

@John-Titor
Copy link
Owner

That sounds promising. If you work out what's going on with WSL2 please share, since that would be worth fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants