s32k144

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

s32k144

1,863 Views
Nexus_Derrick
Contributor II

社区朋友们好,我在使用S32K144的SDK里面的IIC出现一下问题,可以帮忙解答一下吗?我在使用SDK的I2C PAL时,S32K144作为I2C的主机进行数据发送,因为写EEPROM时需要WC引脚控制为低电平,所以我在写之前将WC进行拉低,调用while(STATUS_SUCCESS != I2C_MasterSendDataBlocking(&I2C_Config_instance,&TxBuffer[0],3,true,100));传输3个字节后,并检测返回状态为STATUS_SUCCESS后将WC引脚进行拉高,但是实际抓去的波形却在0x99(图示)就拉高,按道理应该是传输完0x99才会进行拉高吧,这个是为什么呢?

0 Kudos
Reply
4 Replies

1,850 Views
Nexus_Derrick
Contributor II

附带波形

0 Kudos
Reply

1,814 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

请问是哪个版本的SDK?是否方便将测试工程发给我,我在S32K144EVB上测试一下?


Best Regards,
Robin

0 Kudos
Reply

1,777 Views
Nexus_Derrick
Contributor II

Hi,你好:

     附件是我使用的工程,SDK使用的是3.0.0版本

Tags (1)
0 Kudos
Reply

1,671 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

我测试了你的工程,看到的现象与你提供的I2C波形图类似。 查看I2C_MasterSendDataBlocking发现其在LPI2C_DRV_MasterSendData里把最后一个数据传输给transmit FIFO就认为STATUS_SUCCESS。 但LPI2C的transmit FIFO从被写入数据到实际发送完成还需要些时间。

LPI2C_DRV_MasterSendData只开启了部分中断,比如LPI2C_MASTER_FIFO_ERROR_INT、LPI2C_MASTER_ARBITRATION_LOST_INT、LPI2C_MASTER_NACK_DETECT_INT。遗憾的是也没开启或实现 SDF(STOP Detect Flag) Master has transmitted a STOP condition中断事件。

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2173471%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3Es32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173471%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20community%20friends%2C%20I%20have%20a%20problem%20with%20the%20IIC%20inside%20the%20SDK%20of%20S32K144%2C%20can%20you%20help%20me%20out%3F%20I%20am%20using%20the%20I2C%20PAL%20of%20the%20SDK%2C%20S32K144%20acts%20as%20the%20host%20of%20I2C%20to%20send%20data%2C%20because%20I%20need%20the%20WC%20pin%20to%20be%20controlled%20low%20when%20I%20write%20the%20EEPROM%2C%20so%20I%20pull%20down%20the%20WC%20before%20I%20write%20it%2C%20and%20call%20while(STATUS_SUCCESS%20!%20%3D%20I2C_MasterSendDataBlocking(%20%26amp%3BI2C_Config_instance%2C%20%26amp%3BTxBuffer%5B0%5D%2C3%2Ctrue%2C100))%3B%20after%20transmitting%203%20bytes%20and%20detecting%20the%20return%20status%20of%20STATUS_SUCCESS%20the%20WC%20pin%20will%20be%20pulled%20high%2C%20but%20the%20actual%20captured%20waveforms%20are%20pulled%20high%20at%200x99%20(%20Figure)%20on%20the%20pull%20high%2C%20according%20to%20the%20reason%20should%20be%20the%20transmission%20of%200x99%20before%20the%20pull%20high%20it%2C%20this%20is%20why%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2177130%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2177130%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20tested%20your%20project%20and%20saw%20a%20similar%20phenomenon%20to%20the%20I2C%20waveform%20graph%20you%20provided.%20Looking%20at%20the%20I2C_MasterSendDataBlocking%20I%20found%20that%20it%20considers%20STATUS_SUCCESS%20when%20it%20transfers%20the%20last%20data%20to%20the%20transmit%20FIFO%20in%20LPI2C_DRV_MasterSendData.%20However%2C%20it%20takes%20some%20time%20from%20the%20time%20the%20data%20is%20written%20to%20LPI2C's%20transmit%20FIFO%20to%20the%20time%20when%20it%20is%20actually%20sent.%20But%20the%20LPI2C%20transmit%20FIFO%20needs%20some%20time%20from%20the%20time%20the%20data%20is%20written%20to%20it%20to%20the%20time%20it%20is%20actually%20sent.%3C%2FP%3E%0A%3CP%3ELPI2C_DRV_MasterSendData%20only%20enables%20some%20interrupts%2C%20such%20as%20LPI2C_MASTER_FIFO_ERROR_INT%2C%20LPI2C_MASTER_ARBITRATION_LOST_INT%2C%20and%20LPI2C_MASTER_NACK_DETECT_INT%2C%20unfortunately.%20Also%20did%20not%20turn%20on%20or%20implement%20SDF%20(STOP%20Detect%20Flag)%20Master%20has%20transmitted%20a%20STOP%20condition%20interrupt%20event.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2175495%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2175495%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20there%3A%3C%2FP%3E%3CP%3E%20%20%20%20%20Attached%20is%20the%20project%20I'm%20using%2C%20the%20SDK%20is%20using%20version%203.0.0%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2174147%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2174147%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHi.%3C%2FP%3E%0A%3CP%3ECan%20you%20tell%20me%20which%20version%20of%20the%20SDK%20it%20is%20and%20if%20it%20would%20be%20convenient%20to%20send%20me%20the%20test%20project%20so%20I%20can%20test%20it%20on%20the%20S32K144EVB%3F%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%20%3CBR%20%2F%3ERobin%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2173475%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173475%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EAttached%20Waveforms%3C%2FP%3E%3C%2FLINGO-BODY%3E