SCB SPI Slave - tell when SS is negated?

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

cross mob
Anonymous
Not applicable

I'm looking through the SCB datasheet and API as well as the architecture/registers TRMs and don't see a way to either poll or be notified through an interrupt when the SPI slave is no longer selected.

   

 

   

Is there a way to do this that doesn't involve routing SS to two pins, one for the SCB and another that is just a GPIO with an interrupt configured for rising edge?

   

 

   

The reason I'm looking for this is to cleanly reset my SPI reception stack when a master either aborts or otherwise gets out of sync with the receiver software. Counting bytes won't work with aborted transfers. I thought of maybe using a timer which resets the rx software stack on overflow (and is reset whenever a byte is received) but that's kind of hokey.

0 Likes
2 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The data sheet is a little bit silent on the details of the slave operation. But you migth get lucky that SPI_SpiIsBusBusy() also works for slave mode.

0 Likes
Anonymous
Not applicable

That's a really good idea!

   

 

   

the SCB SPI Slave header file (SPIS.h for me) has the following defined:

   
/* SPIS_SPI_STATUS_REG  */ #define SPIS_SPI_STATUS_BUS_BUSY_POS    (0u)  /* [0]    Bus busy - slave selected */ #define SPIS_SPI_STATUS_BUS_BUSY        ((uint32) 0x01u)
   

 

   

Now the actual function doesn't exist, but this is definitely worth looking at. It seems it might be specific to EZSPI but this is a good direction to look.

   

 

   

Somerthing else I've noticed is that the pin-specific APIs seem to be exposed even if the SCB is "in charge" of the line, I might be able to query the pin register directly.

0 Likes