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

sdo not defined during receive command state in SPI Commandinterface #89

Open
hstarmans opened this issue Feb 17, 2021 · 0 comments
Open

Comments

@hstarmans
Copy link

hstarmans commented Feb 17, 2021

In spi.py, i read the following in the class SPI command interface

# Once CS is low, we'll shift in our command.
with m.State('RECEIVE_COMMAND'):
    # If CS is de-asserted early; our transaction is being aborted.
    with m.If(~spi.cs):
        m.next = 'IDLE'

But it should be, something like the following.

# Once CS is low, we'll shift in our command.
with m.State('RECEIVE_COMMAND'):
    m.d.sync += spi.sdo.eq(0)
    # If CS is de-asserted early; our transaction is being aborted.
    with m.If(~spi.cs):
        m.next = 'IDLE'

In the current code, sdo is ill defined if a command is received. This can change depending upon whether a word is sent back.
A description of current behavior is here;
https://github.com/hstarmans/FPGAG/blob/master/test/FPGAG/test_luna.py

@hstarmans hstarmans changed the title sdi not defined during receival of sdi command sdo not defined during receival of sdi command Feb 17, 2021
@hstarmans hstarmans changed the title sdo not defined during receival of sdi command sdo not defined during receive command state in SPI Commandinterface Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants