wiced sense i2c

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi

I'm trying to connect a linear devices LTC2499 ADC to the wiced sense through i2c.  So far, I can't seem to get it to acknowledge -- all I get is NO ACK. I'm using the cfa_bsc_OpExtended command as is used for the other sensors on the board. With this command I can read from the other sensors no problem using their i2c addresses, but the i2c address I give for the ADC never works. I've tried changing the i2c address for the LTC2499 (it is configurable) but none of them connect.

Looking at it with the oscilliscope, I see that SCL is running at 100Hz -- I guess that's the default, as I haven't changed it.  I haven't managed to decode the SDA signal yet -- I guess I'll try adding an external trigger on one of GPIO pins.

Any other things I could try?  Are the commands in i2c.h still broken for the Wiced Sense?  I don't think the actual code for cfa_bsc_OpExtended is available so I can't debug it from the software side.  I'm using SDK 2.2.

Thanks,

Reynald

0 Likes
1 Solution
Anonymous
Not applicable

Hello Reynald,

Questions from our developers:

1.  Can you verify that the LTC2499 works independently?

2.  Again we are able to talk to other sensors so the loading should not be an issue

Thanks,

JT

View solution in original post

0 Likes
6 Replies
Anonymous
Not applicable

Hello reynald,

Here are some things to consider:

  1. The WICED Sense Kit contains 4 sensors on the I2C bus - There is NO I2C expander, which we recommended when adding other I2C devices.
  2. Adding an ADC to the I2C bus may present too much loading for the SDA line
  3. Hint #1: Make sure the ADC is powered at the correct voltage: GPIO Output Logic Level Voltage Changes When UART_RX Disconnected
  4. The I2C bus must NOT be pulled down by any device on the bus until the I2C internal EEPROM has properly booted - The internal EEPROM in the WICED Sense Broadcom device uses the I2C as well
  5. The i2c commands do work and we used it to develop the WICED Sense Code.

Thanks

JT

0 Likes
Anonymous
Not applicable

Hi j.t.,

Thanks for the hints. I am a bit confused about some of the things though.

  1. The WICED Sense Kit contains 4 sensors on the I2C bus - There is NO I2C expander, which we recommended when adding other I2C devices.

==> The schematic of the wiced sense does have a I2C expander, labeled U4. It does look populated on my wiced sense.

2. Adding an ADC to the I2C bus may present too much loading for the SDA line

==> How could I tell if this is the case? The voltages on the SDA line still show 3V when high.  And I can communicate with the other sensors. If the ADC added too much load, wouldn't all the sensors be unreachable?

3.  Hint #1: Make sure the ADC is powered at the correct voltage: GPIO Output Logic Level Voltage Changes When UART_RX Disconnected

==>Thanks.  I verified that the wiced sense VCC  does output 3V (although it is labeled as 3.3V on the pcb).  That's supposed to be sufficient for this ADC, which is rated for 2.7 to 5.5V.

4. The I2C bus must NOT be pulled down by any device on the bus until the I2C internal EEPROM has properly booted - The internal EEPROM in the WICED Sense Broadcom device uses the I2C as well

==> Noted.  My code right now is checking the ADC only after the pressure / humidity / etc. so I believe this is OK. My code does run fine, it just returns NO ACK every time I try to write/read from the i2c address of the ADC.

5. The i2c commands do work and we used it to develop the WICED Sense Code.

==> This comment is a bit confusing to me as every driver in the wiced sense SDK code uses cfa_bsc_OpExtended, as does the i2c_temperature_sensor example.

Also, elsewhere on this community there are warnings against using it, such as: I2C Discussion

Anyways, I tried using i2cm_comboRead but get the same result.

Just to check: I put 10K resistors for pull-ups on both the SDA and SCL lines, connected to VCC. Is that OK?

Reynald

0 Likes
Anonymous
Not applicable

Hello Reynald,

1.  Cool - I worked on the prototype where the I2C Expander was left off

2.  If the ADC added too much load, the internal EEPROM would NOT be able to boot the Broadcom device.

3.  Good.

4.  You should be getting the ACK.

5.  I put that post up in October, let me check if that is still the case.

Yes, the 10K resistors are what you need.

Have you gotten further on the debug?

Let me dig a bit deeper and get back to you.

Thanks

JT

0 Likes
Anonymous
Not applicable

Hello Reynald,

Questions from our developers:

1.  Can you verify that the LTC2499 works independently?

2.  Again we are able to talk to other sensors so the loading should not be an issue

Thanks,

JT

0 Likes
Anonymous
Not applicable

1. That's a good question. I am using the LTC2499 right now via its eval board, the DC1012A, so I assume that it is working properly.  The Vref pin of the ADC gives the value I expect when it is powered.  But I haven't communicated with it independently. The eval board can be connected via a ribbon cable to another "parent" eval board which connects to a pc to try things out, but I haven't bothered with all that yet, as it wouldn't really be the same conditions.  I will check it out, though.

Once established, should the connection between the wiced sense and phone via the app stay up until the phone breaks it? I'm finding it hard to keep the wiced sense awake for more than a minute or so, which makes checking things out on the oscilloscope difficult. Is there somewhere in the code that defines how long the wiced will stay on before going to sleep?  Perhaps something in BLE_PROFILE_CFG could extend this time.  I couldn't figure out what, though.

0 Likes
Anonymous
Not applicable

Got it working. It turns out the ADC returns NO ACK when it is busy doing a conversion. Doh!

One note is that even though it is not documented in cfa.h, you have to bit shift the i2c address << 1 when using cfa_bsc_OpExtended

Reynald

0 Likes