The I2C Device address problem of MQX 4.1.1

cancel
Showing results for 
Search instead for 
Did you mean: 

The I2C Device address problem of MQX 4.1.1

Jump to solution
487 Views
tongjianwu
Contributor III

Hello everyone,

    

          When I got starting with MQX 4.1.1 and tested the E2PROM program,I found the problem which the device address of E2PROM (24LC04) was '0x50',it should be '0xA0' or others.

          the above is the problem with the I2C example, <install_dir>\Freescale\Freescale_MQX_4_1\mqx\examples\i2c

          so, I rectify the address to '0xA0' (AT24C02) for my test E2PROM,I find the start ACK signal is '1' going wrong.

          Can anyone offer me a I2C operation (poll or interrupt based on MQX 4.1.1) example?

          THks!

Best Regards!

Tags (3)
0 Kudos
1 Solution
122 Views
tongjianwu
Contributor III

Hello Soledad,

          I have made a mistake,the I2C device address in MQX should be below format:

          for example, AT24C02, addr = 1 0 1 0 A2 A1 A0 R/W,this should be shift right one bit (addr>>1),then this parameter pass to MQX I2C driver .

          Thks for your help!

Best Regards!

View solution in original post

0 Kudos
3 Replies
122 Views
soledad
NXP Employee
NXP Employee

Hello Tong,

Please check the below thread.

[MQX 4.1]I2C demo for MMA8451Q


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

123 Views
tongjianwu
Contributor III

Hello Soledad,

          I have made a mistake,the I2C device address in MQX should be below format:

          for example, AT24C02, addr = 1 0 1 0 A2 A1 A0 R/W,this should be shift right one bit (addr>>1),then this parameter pass to MQX I2C driver .

          Thks for your help!

Best Regards!

View solution in original post

0 Kudos
122 Views
tongjianwu
Contributor III

Hello Soledad.

     Thks for your reply!

      My hardware situation is based on TWR-K70F120M,using the I2C0 channel which the accelerometer uses.

      For the above program,I use it for accelerometer it can work normally,but for my E2PROM running wrongly.

      So I think whether something wrong with my hardware?

      E2PROM AT24C02,device address '0xA0'

      Have a nice day!

Best Regards !

0 Kudos