SPI + I2C Example Project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-29 12:53 PM - last edited on ‎2024-01-02 6:01 AM by mƎALLEm
Hi,
I am struggling to get SPI and I2C to work at the same time on my project I have tried multiple things (DMA, interrupts etc...) are there any example projects that already have this implemented? I am simply trying to read an I2C sensor value and show it on an SPI screen, as soon as I enable the SPI TFT the I2C returns zero values....
- Labels:
-
I2C
-
SPI
-
STM32F3 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-02 1:57 AM
Hello @Linkpad,
Thank you for your question !
Here some Remark :
- What is your stm32F3 ?
- Can you please share your code/configuration for SPI and I2C ?
- Are you using HAL_I2C_IsDeviceReady() and HAL_I2C_Mem_Read() function ?
- I2C returns zero values -> Is the function return an error or success code ?
- Did you use the debug mode ? Have you scoped SDA and SCL ?
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-02 2:32 AM
Hi Pierre,
Thanks for the advice what was happening in this case is the STM32F303K8 Discovery Board was pulling the I2C system low as soon as SPI was initiated, I swapped the project to an STM32F412G Discovery Board and the problem went away and is now working fine. I think some discovery boards have limitations on functionality (with jumper settings).
Thanks
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-02 8:46 AM
Hi @Linkpad
The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.
Regards,
Billy
