DAVE Tip of the day: Things to note when use SPI001_Configure() APIs to change CSs

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
When use the following commands to change the CSs of 2 SPI001 Controls, both CSs go to zero at the same time for a while.
SPI001_Handle0.Config->CESelected = CE_B;
SPI001_Configure(&SPI001_Handle0,SPI001_Handle0.Config);
SPI001_Handle1.Config->CESelected = CE_B;
SPI001_Configure(&SPI001_Handle1,SPI001_Handle0.Config);


The reason is because there is no clock signal driven out during “re-init.” phase. This will be fixed in the future release.

Workaround:
Set CSx to GPIO output with '1' before switch off USIC CCR.MODE. This is to avoid CS go to '0' level.

Pn_OUT.Px = 1; //set output level =1
Pn_IOCRx.PCy &= ~0x1F;
Pn_IOCRx.PCy |= 0x10; //switch to GPIO output
SPI001_Configure(&SPI001_Handle1,SPI001_Handle0.Config);
0 Likes
0 Replies