S32 LPSPI0 PCS[2] not active

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

S32 LPSPI0 PCS[2] not active

1,182 Views
gellertbalogh
Contributor I

Hello folks,

I need to read out two ADC’s using the LPSPI0 module in the S32k144 controller. The ADC’s ship selects are connected to LPSPI_PCS0 and LPSPI_PCS2 respectively. While the 1st one works like a charm, I have difficulties with the latter. If the pin is set as a GPIO I can measure both High and Low level signals at the 2nd ADC’s chip select pin – thus output stage, trace, soldering, etc. should be fine.

However, if the pin is configured as PCS2 it remains low permanently – despite of the Active Low Setting.

PCS2.png 

In order to be sure, that the code works correctly I tried to use PCS1 instead of PCS2. So the only difference in the code is basically two constants at the initialization: one for the pin itself and one for the SPI module (whichPcs).

 PCS1.png

In a perfect world I could just stay with PCS1. Unfortunately though, we need that particular pin for PWM out. Furthermore this is the 64pin variant, I have no access to LPSPI_PCS3.

Can this phenomenon caused by a chip level error? 

(The ADC I’m using is ADC101S1 from TI. It needs 16 clk pulses to transmit data, and has no data input other than CS)

0 Kudos
4 Replies

840 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

I have just used LPSPI0_PCS2 PTE6 (lpspi_transfer_s32k144 SDK 0.8.5 example) on S32K144-Q100 EVBs (0N47T, 0N57U) and it works.
We don’t have any board with S32K144 in 64-p package but the maskset is the same for all the packages, I assume you have 0N57U, so there should be no difference. Could you try the code with another board/MCU? Have you tried the SDK example?

Regards,

Daniel

0 Kudos

840 Views
gellertbalogh
Contributor I

Hi Daniel,

Thank you for your answer. You have guessed well, the controller is indeed the FS32K144H FVLH 0N57U CTAB1732E.

Today I managed to put my hands on two additional PCBs, unfortunately they produce the same behaviour. I also managed to test our code with a test board (S32K144EVB-Q100X), strangely enough the issue presists. If you have a solution that works, I must assume that our config has some problems which I need to investigate.

Thanks!

0 Kudos

840 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi gellertbalogh

Can you check if output buffer is enabled and and source singal for that pin is the right one?

If you use SDK can you mention which version did you use in your project?

Best regards,

Razvan

0 Kudos

840 Views
gellertbalogh
Contributor I

Hello Razvan,

We use our own code, no SDK. Can you help me where can I find that?

PTE6 is configured as PORT_MUX_ALT2, but I tried out all of the alternatives from 0 to 7. The config for the SPI module is the following:

config.PNG

(TCR switches between C0 and C2 depending on the CS active)

Honestly, I do not understand why changing only the chip select and touching nothing else changes behaviour. That the SPI works with PCS0 and PCS1 gives me confidence about the code.

In the meantime I implemeted a software chip select by explicitly pulling PTE6 to high/low as a GPIO. The ADC seems to be operational. I do not like this solution though, as it involves additional polling. But at least it proves some results.

PTE6.png

0 Kudos