how can i use to i2c between bmi160 sensor and BCM20732(EV Board)?
Development Environment: WICED-Smart-SDK 1.1
BMI 160 connection
- Power : 1.8V power line connected to VDD, VDDIO of bmi160 sensor
- I2C : R5, R4 connection
- Interrupt pin : P25, P24 connection
I was refer to i2c_temperature_sensor simple source and "WICED-Smart-Hardware-Interfaces.pdf" for bmi160 sensor I2C implementation.
I ues cfa_bsc_OpExtended function for I2C.
I saw the message(No slave device with this address exists on the I2C bus.).
bmi160 sensor i2c address is 0x68.
Our hw team say that sensor connection is no problem.
but i can not use cfa_bsc_OpEtended function for i2c.
cfa_bsc_OpEtended function normally operated when i use I2C address of EEPROM(0xA1,0xA0).
I need additional work for I2C when I added device(bmi160 sensor)?
Solved! Go to Solution.
When you say slave address is 0x68, is this the 7 bit control address? If it is, can you try 0xD0 as the slave address parameter to the cfa_* API?
0xd0, 0x68 did not operate.
when i use 0xD0 or 0x68,retrun value of cfa_*api is 3"No slave device with this address exists on the I2C bus".
SDO is connected with GND(Depending on BMI160 DATASHEET).
please could you recommend another check point?
Did you try tracing the I2C lines on an oscope or a logic analyzer to see if the right address is on the bus and the slave is acking it?
connected power line is ok(1.8 volt)
slave address is ok(i see bmi160 datasheet and source code(bmi160 linux drive code).)
What is checking point at I2C line?
current of I2C line is always on?
Both SCL and SDA should be high before I2C communication.
20732 sends start bit and slave address with w/r bit first.
You can check whether BMI160 sends ack by oscilloscope.
I2C line connection is ok.
I confirmed all the slave address(0~255).
but only i could read two slave address for EEPROM(0xA0,0xA1).
did you have been confirmed with other peripherals for I2C?
I think that need more work for bmi160 i2c(i2c configuration,etc)
Does not it?
You mean only 0xa0 and 0xa1 got ACK from slave device, right?
In this case, BMI160 doesn't connect with 20732 properly including power.
When I use three I2C sensors ADXL345, Si1145 and Si7013, they work fine.
I didn't do anything special for them.
Do you have a scope capture of the I2C lines (SCL and SDA) when your app is trying to access the BMI160 sensor?
Do you have a picture of it? I don't think it can be the same. When addressing the EEPROM, you should see a start, 0xA0 (or 0xA1), ack, (address or data), stop and when addressing BMI160, you should see 0x68 or 0xD0 instead of 0xA0 (0xA1).
i did not capture but i saw same signal.
if you need the screen,i will send capture the signal for you.
but now i can't because i have another thing.
maybe next week monday possible.
we use same line for i2c.we refer your document.
i heard from my hw team.
I have One more question.
Can i use another api for i2c?
I found I2CM API.but now this api did not operate,too.
if can i use this api(I2CM) for bmi160 I2C,
Please tell me how to use(Initialization, using method, etc).
I did some research around the I2C API that you mentioned. I am not successful with pretty much the exact same steps that you mentioned. I have in my code the following:
> In the main function (executed once at boot):
//Initialization of the i2cm interface.
> In one second timer function (executed every second):
//write 0xe3 @ device with address 0x40, and read 2 bytes of data.
//0x80 is actually (0x40<<1), 0x40 is the address of the sensor I am trying to access.
UINT8 status = i2cm_comboRead(&readData, 2, &writeData, 1, 0x80);
I ran this piece of code on one device integrated with 20737S that has the sensor connected to it without success. The returned value is **I2CM_BUSY**.
I also ran the same code on the tag board#3 with the 20737 chip. My expectation here is that I should see at least the first write going out to 0x40 with nothing coming back. I don't see anything on the bus (I am connected to J9 connector tag board #3, pin 2(SCL) and 3(SDA)) and the function would return I2CM_BUSY, same as above.
Note: if I sniff the traffic on the I2C bus during the download of an application I do see the access to EEPROM with address A0 and A1 during 5 seconds, so my I2C measurement setup is correct.