First of all, I apologize if this question is repeated.
I am using two DWM1000 modules (datasheet: Decawave DWM1000) in an Arduino Mega and SPI to communicate with them. I have no problems communicating with only one module. But I need to use at least two modules as one will be the transmitter and another as receiver.
Is it possible to assign another GPIO pin other than pin 53 (default chip select pin) as the second module's SS pin?
void setup() {
pinMode(53, OUTPUT);
pinMode(45, OUTPUT);
SPI.begin();
digitalWrite(53, LOW);
// communicating first module here using SPI.transfer()
// MOSI and MISO data transfer have to go between a LOW digitalWrite and a HIGH digitalWrite
digitalWrite(53, HIGH);
digitalWrite(45, LOW);
// communicating second module here using SPI.transfer()
digitalWrite(45, HIGH);
SPI.end();
}
Is this attempt correct?