cancel
Showing results for 
Search instead for 
Did you mean: 

I2C communication with pressure sensor

BME104
Associate

hi, I'm trying to connect this pressure sensor (WF100DPZ) using I2C with stm32 f070RB. But can't understand what address to use for this sensor after reading the datasheet. It'd be great if anyone could help. 

5 REPLIES 5
######
Senior

I can't immediately see the address in the linked datasheet - unless its the actual part ID itself?

Alternatively...

You could try searching for I2C Address scanner example code.

Basically if an I2C address is unknown you can loop through each valid address waiting for an ACK on IfDeviceReady (or similar).

You can then deduce that the addresses that are ACKing are valid device addresses.

Sebastiaan
Senior

Either contact the manufacturer or write a software program that goes through all addresses of 0x00 - 0x7f ?

I've tried running I2C scanner on an arduino to find out the address and it came out to be 0x6D. 

AScha.3
Chief III

Hi,

obviously the producer of this WTF sensor does not know, what he/she is producing, or dont want to tell it.

I would throw it to the trash - and use a sensor from manufacturer that can write a datasheet, like ICP-10100, PSA071040, DPS310XTSA1 etc..

But here : from "datasheet"  :flushed_face:   ->  reg 00 : default 00

AScha3_0-1705305206565.png

chip has CS , so its starting in spi 3 wire mode :  CS , SCK , SD . 

So i would try : just write/read in spi mode , CS can try with hardware NSS , maybe it works; if not soft NSS .

AScha3_1-1705306264551.png

 

 

OR: set CS lo , try I2C on scl + sda , no chip address , just register number + read/write one byte .

But better chance is spi mode , because nothing written about how to switch to I2C mode in ds.

If you feel a post has answered your question, please click "Accept as Solution".

Ok, so has that worked?

I think because of the Read Write bit it would actually be an address of 0x6C 01101100 and then the LSB changes to 1 or 0 (9x6D or 0x6C) for Read and Write respectively.