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

mimxrt: SPI: Set the TCR value returned by MasterBaudSetRate #4474

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

jepler
Copy link
Member

@jepler jepler commented Mar 24, 2021

without this, the baud rate could be wrong; in my testing, it was low by a factor of 2 when requesating baudrate=1_000_000 (1MHz).

When passing the baudrate in to LPSPI_MasterInit, the setting is made automatically, but LPSPI_MAster_SetBaudRate just returns it via the out-parameter tcrPrescaleValue.

This is related to #3062 but is not a solution for it, as there remain long inter-byte gaps.

Now with correct 1MHz SCK rate, but still with multi-microsecond gaps between bytes:
image

without this, the baud rate could be wrong; in my testing, it was
low by a factor of 2 when requesating baudrate=1_000_000 (1MHz).

When passing the baudrate in to LPSPI_MasterInit, the setting is made
automatically, but LPSPI_MAster_SetBaudRate just returns it via the
out-parameter tcrPrescaleValue.
@jepler jepler requested a review from ladyada March 24, 2021 18:35
@ladyada
Copy link
Member

ladyada commented Mar 24, 2021

can you test, whats the max SPI clock rate?

@jepler
Copy link
Member Author

jepler commented Mar 24, 2021

The SPI clock itself will go fast, here's 30MHz:
image

but the gap between bytes gets relatively longer and longer at higher baud rates, limiting the effective throughput:
image

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit e9ceb92 into adafruit:main Mar 25, 2021
@jepler jepler deleted the fix-spi-frequency branch November 3, 2021 21:09
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.

3 participants