I'm using FXAS21002C in my board which is configured for I2C communication. The device is responding through I2C when commanded. Whichever mode it is standby or active, it is not giving device ID when I'm reading 0x0c address. It is reading 0x00 . When I'm reading multiple bytes same set of 7 bytes (first value is 0 and then 6 bytes of same junk data) are found to be repeating whichever address I'm selecting. .when I read a particular address it its always 0x00.
Kindly help..has my device failed and should I replace it? Will device ID be communicated while in standby mode?
Hi Rahul,
In both case (Standby or Active mode), you should be able to read any register you want. For write operation, you need to switch to standby then write whatever you want and then go back active mode to apply changes.
I think you need to check with an oscilloscope or a I²C analyser the I²C frames between your master and the FXAS21002. Please share this material with us for a better support!
Thanks,
Anthony
Hi Anthony
Additional information.
The layout design I have made houses one MAG3110(Magnetometer), one FXAS21002C(gyroscope) and 3 temperature sensors(STCN75) all having inbuilt I2C interface. Im using Smartfusion2 based Emcrafts development board which is configured to have I2C communication using the IP cores available with Smartfusion2 Libero IDE.
The development board works fine with MAG3110 where the I2c communication procedure is identical to FXAS21002C. I2C communication with temperature sensor is also fine. I2C data both in the oscilloscope (which i decoded manually) and the development board says the device ID read is 0x00v(instead of 0xD7) when Im communicating with gyroscope. Some different value comes in the register while in standby mode (data is 0x00) and active mode(0xff). The board is in idle condition while Im accessing FXAS21002C registers.
While accessing FXAS21002C, 'ACK' bits are coming as expected, which means Im properly addressing the device. But the register content is somehow not as expected.
Hi Anthony
Thanks for your reply. I have connected the I2C lines in oscilloscope and have seen the device is responding whenever a communication is initiated. I tried reading multiple times the device ID and since it was not working, I changed the device.
After changing the device too, Im getting similar response. Device ID is coming as zero on power -on
One of the sequence of operation i did im illustrating below.
Sequence 1: (In standy mode)
a. Turned on the device and the device is in standby mode.
b. Initiated a read operation, by first sending a write command with the desired address 0x0c
c. Immediately followed by a read operation. The result expected is the device ID of 0xD7, but Im getting 0x00
Sequence 2: (In active mode)
a. Turned on the device and the device is in standby mode.
b. Initiated a multiple byte write operation starting from the address 0x13 (CTRL_REG1) with the value 0x02, CTRL_REG2 with value 0x00 & CTRL_REG3 with the value 0x01. The device has entered active state(Im assuming)
c. Initiated a read operation, by first sending a write command with the desired address 0x0c
d. Immediately followed by a read operation. The result expected is the device ID of 0xD7, but Im getting 0x00
In both the sequence im getting the value as 0x00. If Im doing independent access of any register, Im getting the value as 0x00. If multiple byte read operation is carried out starting from any register address, then Im getting 0x00 followed by some 6 values of junk data and these 7 data again repeats. All the while I have connected an oscilloscope to see whether I2C communication is OK or not.
In my same board, Im using a MAG3110 IC. In that IC when I do my 'Sequence 1' operation, Im getting the device Id as 0xc4 while reading the address 0x07 as expected. The same code/routine Im using for FXAS21002C as well.
Im pretty stuck at this point, All the help is highly appreciated.
Hi Rahul,
Just to be sure I'm well understanding the situation, let me summarize your issue:
It is very difficult to help you without a screenshot of your scope with the I2C frames.
Regarding your testing, my interrogations are:
Anthony
Write command with register address selected as 0x0c
Read command and in response getting 0xff (expected Device Id: 0xD7) from the device register 0x0c.
The whole plot for the read operation for getting the Device ID:0x07.
Hi Rahul,
Thanks for the material.
I'm not sure to be right, but the small pulse before the SR condition seems strange.
Anthony
Hi
1. Even though I'm giving separate independent pull up resistors for each IC, I have wired only one pair for SCL and SDA lines.
2. "I'm not sure to be right, but the small pulse before the SR condition seems strange." For analyzing this, I used a Rasperry Pi board to initiate I2C communication. Here the waveform is clean and there is no small pulse before the SR condition. But the IC is failing to give the desired register content. (including the DEVICE ID).
3. The Traceability date code on top of the device says - "NCHA". Can you please tell me how to know the date code from this expression.
4. Unfortunately Im still stuck with the issue. All other components in the board with I2C interfaces have been communicated and calibrated successfully. Is there any timing issues that I need to consider while doing the read operation in standby mode (ie. immediately on Power ON).
I have connected the RST_B pin to 3.3V using 47K as recommended in the data sheet.