STM32F429I_DISC1 board and SPI COM with L3GD20(onboard *gyroscope)
- July 29, 2021
- 7 replies
- 4325 views
Hello folks,
Today, I am trying to use SPI communication on my board. I saw that there is a gyroscope on my board. So, I thought it's a good idea to use this device as an example. Since it's already routed it up, I cannot mess up with connections, etc.
Here is the thing, I don't want to install additional libraries. Instead, I want to create/program this example via what everybody starts with. I use CubeIDE. CubeIDE already gives me a bunch of predefined functions with HAL and I assume that function is more than enough to complete this project.
I guess I am able to use SPI since the function returns HAL_OK. However, I cannot read any value from either x, y, or z.
These are the pins according to the datasheet.
This is an SPI configuration made by Cube automatically. I didn't change anything from here.
I upload the program in case someone wants to look at it.
I found these links useful for understanding how they made the chip select SPI, transmit-receive kinda stuff.
https://github.com/MaJerle/stm32f429/tree/master/28-STM32F429_L3GD20
-> This guy uses SPI to communicate
https://www.instructables.com/Learning-About-the-L3GD20-Breakout-Board/
-> This guy uses I2C to communicate
I use SPI but, I'm guessing Majerle doesn't have the SPI_Receive function in DATA_Read.
anyway, that info is a little irrelevant.
I want to learn from my mistakes and get better at this stuff.
THANKS for your attention,
Kind Regards.
*I set pin A1 for interrupt, but I didn't use it for interrupt. Is that the problem? If it's the case then, that might be a very rookie mistake.:grimacing_face:
