S32K314 Simulate IIC using GPIO

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

S32K314 Simulate IIC using GPIO

111 Views
Joker_Y
Contributor II

Hi,

我在使用S32K314,172管脚封装,这三个管脚做模拟IIC的时候,PTD13用作SDA数据管脚,发现MCU无法将SDA配置成开漏输入,导致IIC设备无法拉低SDA。请问应该怎么解决?

Joker_Y_0-1780480319081.png

Joker_Y_1-1780480548110.png

Joker_Y_2-1780480652479.png

 

Joker_Y_3-1780480658189.png

Joker_Y_4-1780480838753.png

在绿色波形箭头位置,我将蓝色的SDA设置为了输入模式,此时应该由外部设备拉低SDA,但实际上并没有被拉低,请问这是为什么?

 

 

0 Kudos
Reply
2 Replies

59 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Joker_Y 

There is no dedicated open-drain configuration available in the SIUL2 module. However, when a pin is configured (muxed) to a peripheral that supports open-drain behavior like LPI2C the pin will behave accordingly and can be used in open-drain mode with other devices.

In these situations, the actual behavior comes from how the peripheral (e.g., LPI2C) is configured rather than SIUL2 itself.

VaneB_0-1780518215080.png

You can configure the following options in the Pins Tool and Siul2 Port driver:

  • Enable/disable the input buffer
  • Enable/disable the output buffer
  • Configure internal pull-up or pull-down
Please note that S32K3 devices already include a native LPI2C designed to handle I2C communication. While it is technically possible to emulate I2C via GPIO using custom software, this approach falls outside the scope of our support. As a result, we are unable to guarantee its functionality or performance.

 

BR, VaneB

0 Kudos
Reply

49 Views
Joker_Y
Contributor II

Hi,VaneB

请问在使用过程中(程序允许过程中),Enable/disable the input bufferEnable/disable the output bufferConfigure internal pull-up or pull-down这些应该怎么操作?你们有没有GPIO模拟软件IIC的demo,可以发一下吗?谢谢

Tags (1)
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2375734%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ES32K314%20Simulate%20IIC%20using%20GPIO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2375734%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHi.%3C%2FP%3E%3CP%3EI%20am%20using%20S32K314%2C%20172%20pin%20package%2C%20these%20three%20pins%20for%20analog%20IIC%2C%20PTD13%20is%20used%20as%20SDA%20data%20pin%2C%20I%20found%20that%20the%20MCU%20can%20not%20configure%20the%20SDA%20as%20an%20open-drain%20input%2C%20resulting%20in%20the%20IIC%20device%20not%20being%20able%20to%20pull%20down%20the%20SDA.%20what%20should%20be%20done%20to%20solve%20this%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Joker_Y_0-1780480319081.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Joker_Y_0-1780480319081.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387680iFDA408C7C10CF472%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Joker_Y_0-1780480319081.png%22%20alt%3D%22Joker_Y_0-1780480319081.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Joker_Y_1-1780480548110.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Joker_Y_1-1780480548110.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387686i737CA1F50B9DF73C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Joker_Y_1-1780480548110.png%22%20alt%3D%22Joker_Y_1-1780480548110.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Joker_Y_2-1780480652479.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Joker_Y_2-1780480652479.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387687iDCD8CFEDD1D86643%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Joker_Y_2-1780480652479.png%22%20alt%3D%22Joker_Y_2-1780480652479.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Joker_Y_3-1780480658189.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Joker_Y_3-1780480658189.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387688iD42A9FB4AA0B55D9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Joker_Y_3-1780480658189.png%22%20alt%3D%22Joker_Y_3-1780480658189.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Joker_Y_4-1780480838753.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Joker_Y_4-1780480838753.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387690iF7802081CD65EE51%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Joker_Y_4-1780480838753.png%22%20alt%3D%22Joker_Y_4-1780480838753.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAt%20the%20green%20waveform%20arrow%20position%2C%20I%20set%20the%20blue%20SDA%20to%20input%20mode%2C%20at%20this%20point%2C%20the%20SDA%20should%20be%20pulled%20down%20by%20the%20external%20device%2C%20but%20it%20is%20not%20actually%20pulled%20down.%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2376432%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K314%20Simulate%20IIC%20using%20GPIO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376432%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHi.%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%3CSPAN%20class%3D%22%22%3E%20VaneB%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%3CP%3ECan%20you%20tell%20me%20what%20should%20be%20done%20to%20Enable%2Fdisable%20the%20input%20bufferEnable%2Fdisable%20the%20output%20bufferConfigure%20internal%20pull-up%20or%20pull-down%20in%20the%20process%20of%20using%20it%20(in%20the%20process%20of%20allowing%20the%20program)%3F%20Do%20you%20have%20a%20demo%20of%20the%20GPIO%20simulation%20software%20IIC%2C%20can%20you%20post%20it%3F%20Can%20you%20send%20me%20a%20demo%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2376093%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K314%20Simulate%20IIC%20using%20GPIO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376093%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F263142%22%20target%3D%22_blank%22%3E%40Joker_Y%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20is%20no%20dedicated%20open-drain%20configuration%20available%20in%20the%20SIUL2%20module.%20However%2C%20when%20a%20pin%20is%20configured%20(muxed)%20to%20a%20peripheral%20that%20supports%20open-drain%20behavior%20like%20LPI2C%20the%20pin%20will%20behave%20accordingly%20and%20can%20be%20used%20in%20open-drain%20mode%20with%20other%20devices.%3C%2FP%3E%0A%3CP%3EIn%20these%20situations%2C%20the%20actual%20behavior%20comes%20from%20how%20the%20peripheral%20(e.g.%2C%20LPI2C)%20is%20configured%20rather%20than%20SIUL2%20itself.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22VaneB_0-1780518215080.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22VaneB_0-1780518215080.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387754i8BA6E14589EE4ED9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22VaneB_0-1780518215080.png%22%20alt%3D%22VaneB_0-1780518215080.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20configure%20the%20following%20options%20in%20the%20Pins%20Tool%20and%20Siul2%20Port%20driver%3A%3C%2FP%3E%0A%3CUL%20class%3D%22lia-list-style-type-circle%22%3E%0A%3CLI%3EEnable%2Fdisable%20the%20input%20buffer%3C%2FLI%3E%0A%3CLI%3EEnable%2Fdisable%20the%20output%20buffer%3C%2FLI%3E%0A%3CLI%3EConfigure%20internal%20pull-up%20or%20pull-down%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%3EPlease%20note%20that%20S32K3%20devices%20already%20include%20a%20native%20LPI2C%20designed%20to%20handle%20I2C%20communication.%20While%20it%20is%20technically%20possible%20to%20emulate%20I2C%20via%20GPIO%20using%20custom%20software%2C%20this%20approach%20falls%20outside%20the%20scope%20of%20our%20support.%20As%20a%20result%2C%20we%20are%20unable%20to%20guarantee%20its%20functionality%20or%20performance.%3C%2FDIV%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E