Urgent help on pic24f16ka102 and mag3110 sensor using i2c

Hi.. Can some one please help me on writing the i2c code just to read the mag3110 sensor data using the pic24f16ka102?

I struggled a lot to implement my own i2c library for the fxos8700cq and somehow i got it work. And I don't want to use all the functions in I2C (Except i2c init, read, write, start, stop). But the same library is not working for the mag3110 and am in desperate need of it.

So please help me on at least reading the WHO_AM_I register of the mag3110 sensor using pic24f16ka102 and how to set the active and idel mode of the sensor?

Reply to
T Obulesu
Loading thread data ...

On Sunday, July 1, 2018 at 7:29:29 AM UTC-4, T Obulesu wrote: I'm not terribly familiar with the PIC24F. That said, when people run into problems with I2C, it is often the case tha t the bus is being released (end of read or write) before a multi-byte tran saction is complete.

I forget the exact compiler or library when a colleague had a similar issue recently, but there was both a "write" and a "write word" choice, or somet hing like that. Basically, one subroutine would send a single byte and rel ease the I2C bus. The other choice would allow for multiple byte transfers before releasing the bus. Obviously, releasing the bus prematurely is goin g to be a problem!

Another quirky I2C issue can be found here:

formatting link

Good luck, and sorry could not be of more help..

Reply to
mpm

hat the bus is being released (end of read or write) before a multi-byte tr ansaction is complete.

ue recently, but there was both a "write" and a "write word" choice, or som ething like that. Basically, one subroutine would send a single byte and r elease the I2C bus. The other choice would allow for multiple byte transfe rs before releasing the bus. Obviously, releasing the bus prematurely is go ing to be a problem!

Thanks for your swift response.. Came to know that there are many victims of this issue... Anyway... If anyone could let me know the small function/ code on: How to initiate the I2C read data write data stop I2c idle I2C without using the library and considering the mag3110 would be more helpful .....

Reply to
T Obulesu

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.