Reply
Highlighted
Posts: 13
Registered: ‎12-20-2016
Accepted Solution

Si7006 Problem Reading Serial Number

I am trying to read a serial number from the Si7006-A20.

 

When I write the I2C address and command codes the second byte of the command code gets a NAK. I see a correct write to I2C address 0x40 a correct write of 0xFA with an ACK and a correct write of 0x0F with a NAK on my logic analyzer. 

 

Once I have done this all other interactions with the device fail with a NAK until I power cycle the device. Creating start and stop conditions without power cycling do not seem to help.

 

I have sent the device reset (0xFE) commands. I don't know if that damaged factory data. I do not think I have sent garbage to the device (I see in other posts it is possible to reset factory calibration).

 

Without trying to read the serial number If I read humidity or temperature it seems to work fine. The temperature increases and decreases with a finger on or off the part.

 

Any clues?

Posts: 59
Registered: ‎04-09-2015

Re: Si7006 Problem Reading Serial Number

We will look into this, but it seems very odd.

 

In the stuck state is SDA pulled low? Can you clock SCL until SDA releases? Can you send us a capture of the issue?

Posts: 13
Registered: ‎12-20-2016

Re: Si7006 Problem Reading Serial Number

In the stuck state SDA and SCL are high. Pulsing either or both of them from the microprocessor does not help.

 
It seems to stay stuck until I detach SDA from the part or I power cycle the part.
 
This is the failure. It looks like the part has simply not ACKed the 2nd byte. The software will not try any reads after that.
 
Inline image 1
 
 
It is strange but if I use the command code 0f fa I get an ACK from the part.
 
Inline image 2
 
Requesting firmware revision command 84 b8 fails in the same way.
 
Inline image 3
 
Reversing the command order for to B8 84 does not work:
 
Inline image 4
 
 

On Wed, Jan 18, 2017 at 1:30 PM, Silicon Labs Community <community@silabs.com> wrote:

Hi mnewman,

 

jogammel (Ninja Employee ) posted a new reply in Optical/RH/Temp Sensor on 01-18-2017 01:30 PM :

 


 

Re: Si7006 Problem Reading Serial Number

 

 

We will look into this, but it seems very odd.

 

In the stuck state is SDA pulled low? Can you clock SCL until SDA releases? Can you send us a capture of the issue?

 

 





 
--
Michael Newman
Dragonnorth Group
www.dragonnorth.com

Phone: 617 566-7975
Cell: 617 821-4608
 
16 Nason Hill Lane
Sherborn, MA 01770
Posts: 59
Registered: ‎04-09-2015

Re: Si7006 Problem Reading Serial Number

I am sorry I was not able to view the images in this post.

 

You may sent them to me directly john.gammel@silabs.com.

 

What do you mean (it seems to stay stuck until you detach SDA).

 

It seems possible the byte order is getting flipped.

Posts: 59
Registered: ‎04-09-2015

Re: Si7006 Problem Reading Serial Number

Thank you for sending the scope shots by email.

 

Can you tell me the data set up and hold time? The hold time in particular looks short. That is, the time from SCL low until SDA can change state.

Posts: 13
Registered: ‎12-20-2016

Re: Si7006 Problem Reading Serial Number

I don't understand what you are asking for. As I understand the bus design data should be sampled on the rising edge of the SCL signal. The time until the data line falls when the clock goes low should not matter.

 

I went looking for hold time definitions in the standard. I saw this capture which shows SDA falling right after SCL:

 

http://www.i2c-bus.org/i2c-primer/how-i2c-hardware-works/

 

In the specification Figure 4 page 9  shows that SDA can change any time after SCL goes low. The same figure also shows the SDA line becoming stable prior to the SCL line going high.

 

http://cache.nxp.com/documents/user_manual/UM10204.pdf

 

Looking carefully at the Si7006 data sheet Tdh is specified at 100 ns from the falling edge of the clock signal. Is this what you are talking about?

 

Note that all other communications work fine. It is only the 2 byte commands that have any issues. The code that controls SDA and SCL is the same for all of the other communications.

Posts: 59
Registered: ‎04-09-2015

Re: Si7006 Problem Reading Serial Number

The requirement of data set up and hold time is not consistent with the general I2C spec., but it is common for I2C slave devices and is in fact included in a similar spec SMBus. For this reason most I2C masters have an option for extending the hold time. Usually set up time is not an issue because SDA goes to its next value immediately after the SCL falling edge.

 

In terms of design, it is common NOT to latch the SDA value on the rising edge of SCL and instead use what is commonly called a transparent latch where SDA propagates through and is held on the falling edge of SCL. This is what creates the hold time requirement.

 

I do not know that the hold time is the issue here but what you are seeing for a result is unexpected so maybe it is an issue. Do you have any way to extend the hold time to check?

Posts: 13
Registered: ‎12-20-2016

Re: Si7006 Problem Reading Serial Number

I increased the hold time and saw no difference. The hold time now is about 0.5 microseconds. Note the SDA glitch after the ACK to the 0xFA. This is where the Si7006 is releasing the SDA after the ACK and the CPU has left the line alone for the hold time before pulling it low for the transmission of the next bit.

 
Inline image 1
Posts: 13
Registered: ‎12-20-2016

Re: Si7006 Problem Reading Serial Number

You asked:

 

          What do you mean (it seems to stay stuck until you detach SDA).

 

Once the device enters whatever error state it gets into the device does not respond to any other I2C messages (never gives an ACK). This can not be cleared by pulsing SCL multiple times nor can it be cleared by pulsing SDA multiple times not even pulsing both. It can be cleared by power cycling the device. It can also be cleared by disconnecting the SDA pin and reconnecting the SDA pin. When connected the SDA pin is pulled up when idle and pulled to ground by the CPU when pulsed.

 

           It seems possible the byte order is getting flipped.

 

You will note from the traces that the byte order is transmitting 0xFA first and 0x0F second. This appears to be what is documented in the data sheet. Please advise if I am wrong about the byte order.

Posts: 13
Registered: ‎12-20-2016

Re: Si7006 Problem Reading Serial Number

I observed voltage differences between the pullups and the power to the part.  The pullups were at a higher voltage than the power to the part (4.5V vs 3.3V). When I brought the pullup voltage down to be similar to the voltage powering the part I was able to correctly read the serial number, reports from my code (I fill the serial number with 3 bytes of FF):

 

 

i2cReadData from I2C address 0x40 8 bytes ROM address 0xFA0F bytes of ROMaddr 2
i2cReadData from I2C address 0x40 6 bytes ROM address 0xFCC9 bytes of ROMaddr 2
Found a Humidity/Temperature sensor serial '0052120006ffffff' at I2C address 0x40
i2cReadData from I2C address 0x40 1 bytes ROM address 0x84B8 bytes of ROMaddr 2
Firmware revision: 20
Humidity sensor found at I2C address 0x40
i2cReadData from I2C address 0x40 1 bytes ROM address 0x11 bytes of ROMaddr 1
heaterControl: 3.09 mA
i2cReadData from I2C address 0x40 1 bytes ROM address 0xE7 bytes of ROMaddr 1
user register: 0x3A
12 bit RH, 14 bit temp Vdd OK heater OFF
i2cReadData from I2C address 0x40 1 bytes ROM address 0x84B8 bytes of ROMaddr 2
Firmware revision: 20

 

 

 

 

It would be interesting to know why one byte commands worked and two byte commands failed, but, this seems related to voltage being improperly high on the data pins. It would also be nice if the I2C pins were 5 volt tolerant.

Posts: 59
Registered: ‎04-09-2015

Re: Si7006 Problem Reading Serial Number

Thank you for reporting this solution.

 

I will pass your comment to our marketing team so we can consider that for future products.