Skip to content

Accelerometer sequencer state machine fix and improved response time #3

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rthomp10
Copy link

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

rthomp10 added 4 commits June 24, 2024 11:28
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.
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 this pull request may close these issues.

1 participant