s32k144 lpi2c1 not working

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

s32k144 lpi2c1 not working

2,302 Views
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

Tags (2)
0 Kudos
Reply
3 Replies

1,430 Views
玉敏111田
Contributor III

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

pastedImage_1.png

0 Kudos
Reply

1,430 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

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

 

Regards,

Daniel

0 Kudos
Reply

1,430 Views
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 Kudos
Reply