johnnyfp
Well-known member
Can someone enlighten me please as to the point of a dedicated labeled CS pin, as in that the CS pins is labeled as such, but it seems that the SPI library or possibly even the SPI Hardware module, doesn't actually use it. And you can use any IO pin for CS.
A lot of the SPI based code that uses the SPI library always seems to set the CS pin in a digitalWrite prior to a transfer, Point taken from the barmetric IDE supplied example
Also looking at the SPITransaction code, it also doesn't seem to use it.
Am I missing something here?
A lot of the SPI based code that uses the SPI library always seems to set the CS pin in a digitalWrite prior to a transfer, Point taken from the barmetric IDE supplied example
Code:
void digitalPotWrite(int address, int value) {
// take the SS pin low to select the chip:
digitalWrite(slaveSelectPin,LOW);
// send in the address and value via SPI:
SPI.transfer(address);
SPI.transfer(value);
// take the SS pin high to de-select the chip:
digitalWrite(slaveSelectPin,HIGH);
}
Also looking at the SPITransaction code, it also doesn't seem to use it.
Am I missing something here?