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

SPI Outputs not initializied with Reset #330

Closed
akaeba opened this issue Jun 1, 2022 · 4 comments · Fixed by #334
Closed

SPI Outputs not initializied with Reset #330

akaeba opened this issue Jun 1, 2022 · 4 comments · Fixed by #334

Comments

@akaeba
Copy link
Collaborator

akaeba commented Jun 1, 2022

Hi Stephan,

if the Reset is applied to the neorv32 the outputs of the spi are staying uninitilized. The SPI uses also only a clock. To avoid unpredictable behaviour needs at least the CSn outputs an reset defined output value. This avoid accidentally activation of the driven SPI component. Better would to assign also CLK and MOSI. In my use case are 180us necessary to assign an valid value.

spi_1

spi_2

If you like i can submit a patch. What do you think?

Greetings,
Andreas

@stnolting
Copy link
Owner

Hey Andreas,

the SPI chip-select lines are initilized, but it takes quite some time since they are configured by a software reset (crt0 writing zero to all IO device's registers) rater than by an actual hardware reset.

I thought this would not cause any troubles with SPI devices. All outgoing SPI signals might be undefined, but for sure there are NO clock pulses generated on the SPI clock line so any SPI peripheral should not perform any internal operations. We also have the same situation during power-up of the FPGA where all FPGA pins might be in tr-istate mode until the FPGA is configured.

However, I am open for a discussion. Maybe it is about time to add a real hardware reset to all IO/peripheral devices. 🤔

@andkae
Copy link

andkae commented Jun 3, 2022

For the SPI looks also good, now is the Chipselect de-asserted with the reset:

image

Thanks for providing the fix!

@stnolting
Copy link
Owner

Awesome! The MOSI signal seems to clear correctly now, too

Same question here: you have used the modified version from #334, didn't you?

@andkae
Copy link

andkae commented Jun 3, 2022

yes i used #334

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.

3 participants