This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can't get HMC6343 compass chip to respond to I2C inquiry on DM6467 system

I have a new board with an HMC6343.  I've tested two boards and they both give the same result.  I have an otherwise working DM6467 system with lots of working I2C.  But it won't work with the HMC6343.  I realize this sounds a lot like a "HMC6343" question and not a "DM6467" question.  But I've already tried with the manufacturer with no success.  I end up asking a specific DM6467 question in question #2 further below.
I've temporarily modified my code to run a dedicated loop accessing ONLY the HMC6343.  I have reduced things to simply sending an address byte 0x32 followed by a command byte, the paitr occurring every 250ms.  However, I fail to get an ack at the end of the address, which makes it seem that the HMC6343 is not responding to the address.  (And thus the command byte isn't sent at all.)  I've contacted the manufacturer and I know the address is correct, comparing his scope traces to mine.  We haven't been able to figure it out yet.
The attached below "HMC6343 scope trace.JPG" shows what I see on the oscilloscope.  The address 0x32 is sent (including lsb lor for write), but at the 9th rising edge, the data line is back high.  I believe this means the HMD6343 is NOT acknowledging the address.  A moment later, the master realizes this and gives up with a stop bit.  This repeats every 250ms.  On the attached jpg, there are two vertical dotted cursors.  It's about clock rise marked by the rightmost cursor that I should be seeing the data
So I can't figure out why the HMC6343 is not acknowledging the address.
My clock rate is about 81kbps.  This is below the 100kbps spec.  It's the default that legacy TI code on their DaVinci chip uses.  I certainly hope that running slower than 100kbps is not a problem for the HMC6343.
So TWO QUESTIONS:
1) Do you have any OTHER ideas why the chip is not giving me an ack in recognition of the address, and
2) How can I change that 81kbps that I inherited from the EVM and DVSDK, either up to 100kbps in case the chip crazily requires fully this speed, or down to something slower in case it doesn't like my data-to-clock setup times?
Thanks very much,
Helmut
"HMC6343 scope trace.JPG" from my system below.  See right cursor at 9th rising edge of clock.  Chip not pulling data low as it should
"HMC6343 0x32_0x50.png" from manufacturer.  His data and clock are identical to mine, except he DOES get the nack from the chip.  in fact, you can see the data pull a little lower on the data line for the nack time period (twice, one nack for the address, and one nack for the followup data byte that he IS able to send).
"HMC6343 0x78 0x50.png" Another graph from the manufacturer, showing a nack response that he forced by providing the wrong address.  Aside from the address bit values, this one looks more like mine.  So indeed my trace looks like the chip isn't recognizing the address I'm giving.
  • Know nothing about HMC6343 and DM6467 but I'll bite.

    From what I can see from the HMC6343 datasheet, it's address is stored in the EEPROM. Perhaps it has been changed. Factory default is noted to be 0x32. In other places in the doc, 0x32 for write and 0x33 for read. So in 7-bit it's really 0x19. Maybe you can try sweeping through the addresses from 0x01 to 0x7F.

    Perhaps the pull-up resistors are too strong for HMC6343. From what I have seen on the EVMs, 2.2K is usually used. The HMC6343 datasheet suggests 10K.

    There are slight differences in the scope captures. The manufacturer capture appears to use 5V signals. The HMC6343 datasheet gives 3.3V. Maybe they have I2C level translator in there somewhere. The level translator might compensate for weak pull down.

    Another difference is that manufacturer capture has a delay between the START and DATA. Just an observation. Maybe nothing. Not sure if the DM6467 I2C controller can insert a delay.

  • Norman,

    Thanks for taking a shot at it.  Perhaps you can mull this around in your head overnight and come back to me tomorrow.

    Below are some positive and negative responses to your shots:

    MISS: It can't be an address issue, because the address sent is identical between my failure and the manufaturer's success.

    MISS: I don't think it can be the pullup.  Note that 10K is WEAKER than 2.2K, not vice versa.  Also spec sheet says 10K.  And regardless, you'd see SOME partial pull down if not complete, in the case of the resistor being too strong.  This would be similar in nature to the mfgr scope trace where you discover the I2C bottom line is a little above ground, but when the chip pulls NACK it goes closer to ground a bit.  You'd see some kind of thing like this, even pulling down from 3V to 2.8V or something.

    HIT: I too noticed that 5V vs 3.3V thing.  I inquired.  The manufacturer replied that he's indeed running 5V with no translators.  I wrote back earlier today asking how this can be, when the data sheet says only up to 3.6V supply.  I'm waiting to hear back on that.  But if the spec sheet is right, then it ought to work at 3.3V.  Note I didn't check the EXACT high and low voltage on the I2C.  It should be fine, though, above and below normal logic thresholds.  I intend to check that as well again later.

    HIT: Not sure what kind of hit, but I was wondering about timing too.  I think data should be captured on the rising edge of the clock, but spec says data should remain stable throughout clock high.  I appear to have no worse than zero hold time after clock falling edge, but perhaps it's in fact slightly negative.  If the HMC6343 is seeing it as this, then it could be thinking a logical STOP was issued (data rise while clock high), or confused by a second logical START (data fall while clock high).  This made me wonder about slowing down.  HEY, YOU DIDN'T ANSWER THAT.  WHERE DOES THE CLOCK COME FROM?  I CAN'T FIND IT.  I WANT TO SLOW IT DOWN OR SPEED IT UP.  Finally, regarding the actual delay between START and DATA, I see that now.  Dunno how to make a change...

    Thanks again, and perhaps you'll get an inspiration for me overnight.  That's when I normally get mine, but there are none forthcoming for me on this particular problem!

    -Helmut

  • As Homer Simpson would say "50:50, I like them odds".

    I was thinking that your instance of the HMC6343 might have a reprogrammed or corrupted address. Not sure how easy it is for that to happen. I did not look in the datasheet too deeply.

    My thinking on the pull-up resistors was that the device might be strong enough to pull down a 10K but not strong enough to pull down a 2K.

    I learned it the same way. Data changes on falling edge and sampled on rising edge. Implies stable after the rising edge or clock high. I suppose if the device is really really really slow to respond, it will could sample after the subsequent falling edge.  Not many chips use the slow 40kbps.

    Changing the I2C clock frequency means digging into the Linux driver. Vaguely remember the code is separated in a common core layer, algorithms and adapters. I think somewhere in the adapters layer, the driver will setup the clock. The frequency may be sent down from the board/platform file.

  • FYI, I already searched the board/platform file board_dm646x_evm.c and can't see it coming from there.  I stopped probing down in the "well" at a search for *device_create(

  • FYI device_create I was calling from my own drivers in board_dm646x_evm.c, and they made a pdev.  Elsewhere git code gets a clock rate out of pdev.  But I haven't been able to connect those top-down and bottom-up ends...

  • ...my dead end is clkdev.c has clk_find() called from higher up by passing a pdev.  Inside clk_find() it's searching some list of clocks.  I thought somehow from above, device_create() would have clock info that goes into such a list, but I can't find it!