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

TWD going into idle depends on TX Fifo content #1157

Open
LukasP46 opened this issue Jan 15, 2025 · 2 comments · May be fixed by #1158
Open

TWD going into idle depends on TX Fifo content #1157

LukasP46 opened this issue Jan 15, 2025 · 2 comments · May be fixed by #1158

Comments

@LukasP46
Copy link
Contributor

First of all, I am still working out the details and may find a solution along the way.

Situation: I read (one or more) bytes from the Neorv32 as TWD.

It depends on the last read value if the twd engine.state returns to idle. It seems that the MSB of the value has to be '1' to succeed, but I haven't tested all possibilities.

The corresponding C code is really simple:
neorv32_twd_setup(TWD_DEVICE_ID, 0, false, false, false);
neorv32_twd_put(0x06);
neorv32_twd_put(0x81); // won't work if < 0x80

And I just read the two bytes from a host.

I already see that the stop signal isn't noticed anymore. Like I said, I'll look into it myself, but now it's noted here for everyone to read.

@LukasP46 LukasP46 changed the title TWD goint into idle depends on TX Fifo content TWD going into idle depends on TX Fifo content Jan 15, 2025
@LukasP46 LukasP46 linked a pull request Jan 15, 2025 that will close this issue
@stnolting
Copy link
Owner

stnolting commented Jan 15, 2025

Are you sending an ACK from the host to the TWD after reading a byte?

twd_sequences

Your example code seems to work here 🤔

@LukasP46
Copy link
Contributor Author

Ah now I see where the problem might come from. When the master does not want to read more bytes, it does not acknowledge the last transfer (for example written here in chapter 3.2.2: mikrocontroller.net/attachment/372171/I2C_bus.pdf).

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

Successfully merging a pull request may close this issue.

2 participants