S32K148 PTB27 LPSPI2_SOUT alway high when SPI Channel is no active

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

S32K148 PTB27 LPSPI2_SOUT alway high when SPI Channel is no active

Jump to solution
1,488 Views
shijie_zheng
Contributor III

Hi:

I select  s32k148 Port PTB27 as LPSPI2_SOUT function,
after PTB27 is initialized:

PORTB->PCR[PIN_INDEX_27] |= PORT_PCR_MUX(PIN_FUNCTION_ALT5);
PTB->PDDR |= (DIR_OUTPUT << PIN_INDEX_27);

i find PTB27 Port becomes high level,
but,i want PTB27 keep low when no spi data is send,as well,
when mcu go to VLPS mode, i want PTB27 also keep low.

I have try to re-initialized PTB27 function to PIN_FUNCTION_ALT1 before mcu
go to VLPS mode,and set:PTB->PCOR |= (1 << PIN_INDEX_27);
but PTB27 still keep high(The software must
ensure to enable only one function at a time,so i think re-set to PIN_FUNCTION_ALT1 doesn't work).

What is the reason for this?
Is there a way to keep SPI OUT low when SPI is idle?

init.jpg

 

 

 

 

 

 

idle.jpg

0 Kudos
Reply
1 Solution
1,469 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

You can set OUTCFG = 1 and the MOSI pin will be tristated while PCS is deaserted.

The pin can be pulled down.

 

Regards,

Daniel

View solution in original post

0 Kudos
Reply
2 Replies
1,470 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

You can set OUTCFG = 1 and the MOSI pin will be tristated while PCS is deaserted.

The pin can be pulled down.

 

Regards,

Daniel

0 Kudos
Reply
1,458 Views
shijie_zheng
Contributor III

Hi danielmartynek:

I have  test according to the method you share, and the result is valid,thank you very mach.

0 Kudos
Reply