I2C Communication RT1050

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C Communication RT1050

Jump to solution
1,811 Views
rubensjunior
Contributor IV

Dears,

I want to understand I2C communication on RT1052. So, I transfer the SDK example: lpI2c_interrupt.c. Please would like to know if the IMXRT1050-EVKB Evaluation Kit is capable of running this example and simulating I2C communication. If the Kit is capable of simulating communication, I would like to know which element will be the master and which element will be the slave.

Best Regards,

Rubens Júnior

1 Solution
1,613 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rubens Junior ,

  Of course, you can, you can use this SDK i2c code:

SDK_2.6.1_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\lpi2c\interrupt

And test it in the MIMXRT1050-EVKB board, this project already support both I2C master and slave

You just need to do the following setting:
To make lpi2c example work, connections needed to be as follows:

        LPI2C1 SCL(J23-6)     -->          LPI2C3 SCL(J22-1)
        LPI2C1 SDA(J23-5)     -->          LPI2C3 SDA(J22-2)

Then,after you download the code, you can find the printf data:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LPI2C example -- MasterFunctionalInterrupt_SlaveFunctionalInterrupt.
Master will send data :
0x 0  0x 1  0x 2  0x 3  0x 4  0x 5  0x 6  0x 7
0x 8  0x 9  0x a  0x b  0x c  0x d  0x e  0x f
0x10  0x11  0x12  0x13  0x14  0x15  0x16  0x17
0x18  0x19  0x1a  0x1b  0x1c  0x1d  0x1e  0x1f

Slave received data :
0x 0  0x 1  0x 2  0x 3  0x 4  0x 5  0x 6  0x 7
0x 8  0x 9  0x a  0x b  0x c  0x d  0x e  0x f
0x10  0x11  0x12  0x13  0x14  0x15  0x16  0x17
0x18  0x19  0x1a  0x1b  0x1c  0x1d  0x1e  0x1f

This time , slave will send data:
0xff  0xfe  0xfd  0xfc  0xfb  0xfa  0xf9  0xf8
0xf7  0xf6  0xf5  0xf4  0xf3  0xf2  0xf1  0xf0
0xef  0xee  0xed  0xec  0xeb  0xea  0xe9  0xe8
0xe7  0xe6  0xe5  0xe4  0xe3  0xe2  0xe1  0xe0

Master received data :
0xff  0xfe  0xfd  0xfc  0xfb  0xfa  0xf9  0xf8
0xf7  0xf6  0xf5  0xf4  0xf3  0xf2  0xf1  0xf0
0xef  0xee  0xed  0xec  0xeb  0xea  0xe9  0xe8
0xe7  0xe6  0xe5  0xe4  0xe3  0xe2  0xe1  0xe0

you can try it on your side.

If you still have questions, please kindly let me know.

Have a great day,
Kerry

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

4 Replies
1,614 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rubens Junior ,

  Of course, you can, you can use this SDK i2c code:

SDK_2.6.1_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\lpi2c\interrupt

And test it in the MIMXRT1050-EVKB board, this project already support both I2C master and slave

You just need to do the following setting:
To make lpi2c example work, connections needed to be as follows:

        LPI2C1 SCL(J23-6)     -->          LPI2C3 SCL(J22-1)
        LPI2C1 SDA(J23-5)     -->          LPI2C3 SDA(J22-2)

Then,after you download the code, you can find the printf data:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LPI2C example -- MasterFunctionalInterrupt_SlaveFunctionalInterrupt.
Master will send data :
0x 0  0x 1  0x 2  0x 3  0x 4  0x 5  0x 6  0x 7
0x 8  0x 9  0x a  0x b  0x c  0x d  0x e  0x f
0x10  0x11  0x12  0x13  0x14  0x15  0x16  0x17
0x18  0x19  0x1a  0x1b  0x1c  0x1d  0x1e  0x1f

Slave received data :
0x 0  0x 1  0x 2  0x 3  0x 4  0x 5  0x 6  0x 7
0x 8  0x 9  0x a  0x b  0x c  0x d  0x e  0x f
0x10  0x11  0x12  0x13  0x14  0x15  0x16  0x17
0x18  0x19  0x1a  0x1b  0x1c  0x1d  0x1e  0x1f

This time , slave will send data:
0xff  0xfe  0xfd  0xfc  0xfb  0xfa  0xf9  0xf8
0xf7  0xf6  0xf5  0xf4  0xf3  0xf2  0xf1  0xf0
0xef  0xee  0xed  0xec  0xeb  0xea  0xe9  0xe8
0xe7  0xe6  0xe5  0xe4  0xe3  0xe2  0xe1  0xe0

Master received data :
0xff  0xfe  0xfd  0xfc  0xfb  0xfa  0xf9  0xf8
0xf7  0xf6  0xf5  0xf4  0xf3  0xf2  0xf1  0xf0
0xef  0xee  0xed  0xec  0xeb  0xea  0xe9  0xe8
0xe7  0xe6  0xe5  0xe4  0xe3  0xe2  0xe1  0xe0

you can try it on your side.

If you still have questions, please kindly let me know.

Have a great day,
Kerry

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,613 Views
rubensjunior
Contributor IV

Dear kerryzhou‌,

The bellow scheme connection it is correct for the evkbimxrt1050_lpi2c_interrupt sample. Please could you tell me wich scheme is required to test the lpi2c_interrupt_b2b_transfer_master and lpi2c_interrupt_b2b_transfer_slave samples.

pastedImage_1.png

Have a great day!

Rubens Júnior

0 Kudos
1,613 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rubens Junior,

   You can check the readme in the lpi2c_interrupt_b2b_transfer_master and lpi2c_interrupt_b2b_transfer_slave  project:

Hardware requirements
=====================
- Mini/micro USB cable
- Two EVKB-IMXRT1050 board
- Personal Computer

Board settings
==============
LPI2C one board:
  + Transfer data from MASTER_BOARD to SLAVE_BOARD of LPI2C interface, LPI2C1 pins of MASTER_BOARD are connected with
    LPI2C1 pins of SLAVE_BOARD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MASTER_BOARD        CONNECTS TO         SLAVE_BOARD
Pin Name     Board Location     Pin Name     Board Location
LPI2C1_SCL   J23-5              LPI2C1_SCL   J23-5
LPI2C1_SDA   J23-6              LPI2C1_SDA   J23-6
GND          J24-7              GND          J24-7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So, you need to use two board to these the master and slave.

Wish it helps you!

Have a great day,
Kerry

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,613 Views
rubensjunior
Contributor IV

Thank you kerryzhou‌! It's work fine!

0 Kudos