Difference between hardware CS pin and GPIO CS pin?

I'm beginning a project and setting up some SPI devices on a Teensy 4.1. I see on the pinout diagram that pins 36, 37, 10, are all labeled "CS". My understanding is that most SPI libraries can use any GPIO pins as CS. If this is true, is it worth the trouble to use the dedicated hardware CS pins, or am I okay with using GPIO pins most convenient for routing? I guess also -- are there any driving factors that should/would make me want to switch over to those hardware CS pins over GPIO pins?

I need 4 CS pins (2 on SPI0, 2 on SPI1 if it matters). The devices using these chip select pins have maximum clocks of 7 MHz and 10 MHz on SPI0; 12 MHz and 10 MHz on SPI1.

Thanks!
 
If a library is written to use a GPIO as CS then it's not going to matter which pin is used.

The only advantage of using the hardware CS pins is that the SPI hardware can control them automatically when a transaction happens (so no need for manually calling digitalWrite(LOW / HIGH) ), but if a library already has those calls in the code there won't be anything gained.
 
This depends on ...

That is for example with Teensy 3.x boards, display drivers using hardware CS pins for both CS and especially DC can get a very significant speed up. Why? note I am going to use psuedo names for commands.

For example drawing a point: the code may output: <SET X> x1 x2 <SET Y> y1 y2 <fill memory> color
For each of these commands, like <SET X>, it has to assert the DC pin and after unassertive. Note the CS pin may also be
set and cleared probably around the whole logical command, or maybe only at the beginTransaction/endTransaction.

With GPIO settting/clearing, we have to wait until all of the data has been sent out the SPIO pins, before we can change
their state, which leaves reasonably large gaps of time between outputs. With the T3.x we can change the state of multiple CS pins as part of each output to the queue. thus removing those gaps. That is why Paul's ILI9341_t3 library is so much faster than the Adafruit ILI9341 library. With T4.x you can only work with up to one hardware CS pin at a time and it did not gain us as much.
 
Thanks to everyone who reports spam!

I deleted the 2 spam messages from this thread, banned the spammer's account, permanently blocked 32768 IP numbers, and added network ASN 214413 to a list which blocks new user registrations.

Spammers are getting trickier with use of AI to craft plausible messages and editing prior messages within the 2 hour window we allow. Reports with just a few words about what spammy behavior was seen really do make all the difference.
 
Back
Top