Author Topic: [Zero Gecko] I2C read data without repeated start  (Read 1670 times)

0 Members and 1 Guest are viewing this topic.

Offline DanioIOTopic starter

  • Contributor
  • Posts: 35
[Zero Gecko] I2C read data without repeated start
« on: October 11, 2014, 03:08:08 pm »
Hi,
Im working on a simple LiPol projects and im using LTC2942 Fuel gauge ic. I want to read data from that ic using zero gecko microcontroller, but the problem is that its default library emlib doesnt support read command without repeated start which my fuel gauge requires (its using SMBus). Does anyone know how to fixed it?
I tried simple write to register and than read but because of the stop condition after each command this approach doesnt work.

LTC2942 datasheet (http://cds.linear.com/docs/en/datasheet/2942fa.pdf)
Aplication note on using SMBus as an I2C device (http://www.ti.com/lit/an/sloa132/sloa132.pdf)
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: [Zero Gecko] I2C read data without repeated start
« Reply #1 on: October 13, 2014, 04:13:11 pm »
The emlib library documentation suggests that using an I2C_FLAG_WRITE_READ sequence with the I2C_TransferInit() function will cause a repeated start to be used.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf