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!
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:
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