Forum Discussion
Why would these two clear on reads behave differently?
- 6 years ago
Well, that looks basically ok.
I would have to assume that input CS is only valid for a single clock cycle. Correct?
Or if CS is valid for more than one clock cycle then SPI_RD is only valid for one clock cycle.
Otherwise if CS and/or SPI_RD is present for two (or more cycles) the register will be read once, then cleared, then read again with the value zero.
What is the trigger to execute block A vs block B? You don't show it.
SPI is a serial bitstream, so it will take some time to shift the data out to it.
Is 'spi_out' also used as the shift register, or is it loaded at some point into the actual SPI shift register.
Without having more context it is not possible to determine why you see this behavior.
Taken in isolation, blocks A and B should work, given that each block is just triggered once per observation.