S32K148 PTB27 LPSPI2_SOUT alway high when SPI Channel is no active

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

S32K148 PTB27 LPSPI2_SOUT alway high when SPI Channel is no active

跳至解决方案
1,489 次查看
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 项奖励
回复
1 解答
1,470 次查看
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 项奖励
回复
2 回复数
1,471 次查看
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 项奖励
回复
1,459 次查看
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 项奖励
回复