s32k144 lpi2c1 not working

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

s32k144 lpi2c1 not working

2,182 次查看
lohrsistemas
Contributor IV

I've configured the lpi2c1 like the example code with processor expert, but my i2c pins always stays in high level because the pull ups. The only difference is that my pins are the secondary, PTB9 and PTB10.

IOs:

pastedImage_1.png

lpi2c:

pastedImage_2.png

PCC (clock source):

pastedImage_3.png

in the main.c the 3 functions used:

LPI2C_DRV_MasterInit(FSL_LPI2C1, &lpi2c1_MasterConfig0, &lpi2c1MasterState);

LPI2C_DRV_MasterSetSlaveAddr(FSL_LPI2C1,  0x3E, 0);

LPI2C_DRV_MasterSendDataBlocking(FSL_LPI2C1, buffer, TRANSFER_SIZE, true, 10U);

I don't know if there is another configuration that I missed. I tried to put this pins to work as output and worked properly.

I tried a example that I found here in the forum and the functions stops when check the busy register: ((LPI2C0->MSR & (1 << 25)), always returns busy.

Thanks

标记 (2)
0 项奖励
回复
3 回复数

1,310 次查看
玉敏111田
Contributor III

How did you correct it ? I came up with this problem.THS

pastedImage_1.png

0 项奖励
回复

1,310 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Please see the description of PINCFG bit field in MCFGR1 register.

 

Regards,

Daniel

0 项奖励
回复

1,310 次查看
AlinaB
NXP Employee
NXP Employee

Hello,

Secondary Clock Line (SCLS) and Secondary Data Line (SDAS) are used only if master/slave are configured to used separate pins. Lpi2c driver doesn't support 4-wired mode, therefore SCLS and SDAS pins are not used.

The lpi2c driver works only if you use first SCL and SDA lines.

Best regards,
Alina

0 项奖励
回复