-
Notifications
You must be signed in to change notification settings - Fork 60
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
SPI Readings Incorrect on MISO LSB #81
Comments
I think we may be operating the peripheral incorrectly. The manual states that specific bits in This is confirmed when inspecting SPI driver code from ChibiOS HAL: /* SPI setup and enable.*/
spip->spi->CR1 &= ~SPI_CR1_SPE;
spip->spi->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SSM |
SPI_CR1_SSI;
spip->spi->CR2 = spip->config->cr2 | SPI_CR2_SSOE | SPI_CR2_RXDMAEN |
SPI_CR2_TXDMAEN;
spip->spi->CR1 |= SPI_CR1_SPE; |
What are you getting in |
The |
I downloaded the crate locally and implemented the change; I set the settings first, then set SPE=1. It didn't seem to fix my problem. I'll keep messing with the settings. Changes to STM32L0XX-HAL::spi
Output
|
Sounds to me like you are hitting HW bug. Take look at the errata section 2.6.2. The problem is basically speed of the SCK pin. Unless your SCK pin connection has capacitance higher than 30 pF, setting the SCK pin speed as High or Very High should mitigate the issue. (It worked for me). |
I'm seeing a strange problem with the Full Duplex SPI library I can't figure out. Any help is appreciated!
The LSB on my reads usually comes back flipped even though my oscilloscope shows the slave output to be as expected. Only the MISO LSB is affected. This happens no matter what I'm reading or which slave device I connect.
I'm running code on a STM32L031 Evaluation Board. The example below is with a TI CC1200 as the slave.
Example
The master writes 0x3D two times. The slave returns 0x0F two times (As confirmed by the oscilloscope). The transfer function incorrectly returns 0x0E 0x0F
My Code:
Code Output:
Buffer After Transfer: 14,15
Oscilloscope Output:
Things I've Tried:
The text was updated successfully, but these errors were encountered: