S32K3 MBDT - SPI clock poor timing

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

S32K3 MBDT - SPI clock poor timing

553 Views
LyingCake
Contributor II

I have encountered two issues relating to the SPI clock on a S32K344 when integrating with an ADE7912.

  • There is an undesired leading pulse on the SPI clock causing a bit-shift, corrupting the data.
    • I am unable to resolve this issue by delaying the chip select, as the chip select is on a MUX IC and controlled through GPIO. I have attached my SPI configuration from the S32 configuration tool, and the output from a logic analyzer.
  • The clock duty cycle is not fixed at 50% when at high speeds. At 4MHz, the duty cycle of the clock is around 65% which does not meet the timing requirements of the selected SPI device. Lowering the SPI clock speed to 2MHz results in a duty cycle of 58%. Please advise how to ensure a 50% duty cycle at 4MHz.

Any advise for resolving these issues would be appreciated.

s32k344_spi_clk_issues.png

spi_config_2.png

 

spi_config_1.png

 

Tags (3)
0 Kudos
Reply
3 Replies

497 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

1) seems the behavior you see is due to driver implementation of a workaround for errata 0050456, when module reset is used. This puts clock pulse and sets SOUT high until data is transmitted. This is not an issue for slave devices if really controlled by CS and SCK, but for usage you have it would bring issue.
Try to do not use module reset and keep resetting the FIFO using CR[RTF] and CR[RRF]
image (2).png

2) this can be issue of the analyzer sample rate, but also for higher rates, try to increase pins drive strength.

3) to read more bytes from slave you need to send required dummy bytes from master keeping CS selected.

BR, Petr

0 Kudos
Reply

484 Views
LyingCake
Contributor II

Thank you for your response @PetrS.

0 Kudos
Reply

514 Views
LyingCake
Contributor II

In addition to the issues described above, I have been unable to find a way to have the SPI clock continue after the MOSI signal is complete. During a read operation, the slave device requires a clock signal to continue pulsing while the response is broadcasted on MISO. Can you provide instructions on how to configure SPI for a read operation.

0 Kudos
Reply