Accelerometer sequencer state machine fix and improved response time#3
Open
rthomp10 wants to merge 4 commits intovpecanins:masterfrom
Open
Accelerometer sequencer state machine fix and improved response time#3rthomp10 wants to merge 4 commits intovpecanins:masterfrom
rthomp10 wants to merge 4 commits intovpecanins:masterfrom
Conversation
The clock is 10MHz and the default div_coef is 10k. This sets the spi clock to 500Hz (1kHz/spi clk transition). The accelerometer spi read spec is 10MHz, so we have plenty of room to speed up the reads. Setting the div_coef to 200 sets the spi clock to 25kHz. It takes 25 iterations to get the new value, so the new response time is about 1ms.
the led assignment was made at the beginning of the spi read, therefore assigning the last result to the leds. the led wait state was added to the sequencer fsm to wait until the spi read is finished, and then it writes the result to the leds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For convenience, a compile script was added along with an SPI port definition fix in the testbench. The sequencer also now correctly assigns the LEDs once the SPI read is finished. The SPI read speed was also set to update the LEDs about every 1ms.
stp1.stp