03-10-2024 07:21 PM
Hi everyone,
For my master's thesis, I designed a PCB with Bosch BMP384 sensors. In my previous version, I utilized 4-wire SPI for communication. However, in the newest version, I decided to switch to 3-wire SPI. I am using an Arduino to communicate with the sensors, and I found a GitHub repository from Bosch that explains how to write code for sensor communication (https://github.com/boschsensortec/BMP3_SensorAPI). The GitHub repository only provides code examples for 4-wire SPI and does not cover 3-wire SPI.
The sensors uses 4-wire SPI by default, to use 3-wire SPI, bit 0 of register 0x1A needs to be changed from 0 to 1. I have tried multiple approaches, but I am unable to make it work. Does someone have an example of how to set up 3-wire SPI communication with a Bosch sensor?
Thank you in advance.
03-11-2024 06:53 AM
Hi Christoforos,
In addition to setting IF-CONF to 3-wire SPI, you need to ensure that the schematic is connected according to the 3-wire SPI.
The remaining work requires the host driver to access BMP384 through a 3-wire SPI.
03-11-2024 12:29 PM
Hi,
The schematic of my PCB is indeed the same as in the picture. However, my struggle lies in the code. I don't know how to program the code to set up the 3-wire communication.
03-12-2024 09:57 PM
This is the code I made to write on register 0x1A and to read on register 0x00 to see what the chip_id is. The chip id should be 0x50.When I read the register, I'm getting either 255 or 0 as the output, indicating a mistake in my code. Does someone know what I did wrong?