How to set CSx of DSPI for MPC5744P

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

How to set CSx of DSPI for MPC5744P

511 Views
金翅大鹏鸟
Contributor II

Hello!

      I meet two trouble in using the MCU MPC5744P(144pin).

1. I want to use the a general gpio ( PD[1]) as cs signal instead of DSPI's DSPI_CSx(PA[5]). Is it OK?

2. I want to control two devices with DSPI1, CS0 is PA[5],CS1 is PG[2].But how can I control the two devices or how to set the CSx?

   Thanks!

Labels (1)
0 Kudos
1 Reply

409 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

1. There's no DSPI_CSx function on PD[1], so the only way is to use this pin as GPIO, configure it as output and toggle the output manually as needed. Example of pseudo code:

assert_CS(); //set PD[1] to '0' by GPDO register

DSPI_PUSHR = xxxx;   //send data

while(...);   //wait until the data are sent

deassert_CS();   //set PD[1] to '1' by GPDO register

2. See the description of PUSHR register:

pastedImage_1.png

pastedImage_2.png

Transmission is initiated by write to PUSHR register. PCS bit field says, which chip select will be used. If you configure the PCS to 0b1, chip select 0 will be asserted. If you configure the PCS to 0b10, chip select 1 will be asserted...

Regards,

Lukas