I Need Simple I2C Example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I Need Simple I2C Example

ソリューションへジャンプ
3,043件の閲覧回数
skb
Contributor II

Hello everyone,

it is very hard to make a initilaize code using NXP,

 

I want to make a I2C code.

in IDE, s32k116_Project_LPI2C project shows that I2C example.

but, it is not work. there is no pulse feedback in PTA2 and PTA3  pin(SDA,SDL)

I looking for some code to communicate Master - Slve, easily

I'm already make a code by using ST HAL library.

I using I2C I/O Expander IC TCA9539.

slve address 0x74 because A0, A1 is low.

And I sand 0xE9 to use it only read mode.

I make it follow code.


uint8_t data[16];
HAL_I2C_Master_Transmit(&hi2c1, 0x74, data, 16, 10); //Awake 
HAL_Delay(1); // Delay
HAL_I2C_Master_Transmit(&hi2c1, 0xE9, data, 16, 10); // Set data readonly
HAL_Delay(1); // delay
HAL_I2C_Master_Receive(&hi2c1, 0xE9, data, 16, 10); // read data from IC

 

please,,, I want make code like that.. How can I?

タグ(4)
0 件の賞賛
返信
1 解決策
3,024件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi skb,

s32k116_Project_LPI2C is none SDK example. Recommend you refer the lpi2c_master_s32k116 and lpi2c_slave_s32k116, which can be found in S32SDK S32K1xx RTM v3.0.0 Examples Projects.

lpi2c_master_s32k116.png

LPI2C MASTER guide.png

Best Regards,
Robin
-------------------------------------------------------------------------------
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 返信
3,025件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi skb,

s32k116_Project_LPI2C is none SDK example. Recommend you refer the lpi2c_master_s32k116 and lpi2c_slave_s32k116, which can be found in S32SDK S32K1xx RTM v3.0.0 Examples Projects.

lpi2c_master_s32k116.png

LPI2C MASTER guide.png

Best Regards,
Robin
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------