What is the best way to check to see if the SPI pins are working on a DUE. I tried programming and the usb port came unplugged. Since then it doesn't seem to work. The blink sketch works fine. Maybe I,m just missing something.
Hi E-Car,
Have you got a multimeter?
I assume if you are into cars you must have since car electrics are a law unto themselves right?
![]()
Right, the SPI pins on the DUE are :- MISO 74, MOSI 75, SCK 76. So, you can check them with a multimeter / led with 200R resistor by the following sketch :-
void setup() {
// put your setup code here, to run once:
pinMode(74, OUTPUT);
pinMode(75, OUTPUT);
pinMode(76, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(74, LOW);
digitalWrite(75, LOW);
digitalWrite(76, LOW);
delay(2000);
digitalWrite(74, HIGH);
digitalWrite(75, HIGH);
digitalWrite(76, HIGH);
delay(2000);
}
Hope this helps!
Regards,
Graham
The SPI pins on every Arduino are MOSI, MISO and SCK. As in...
pinMode(MOSI, OUTPUT);
digitalWrite(MOSI, HIGH);
There's also other fun pins-without-numbers such as TXLED on the Micro.
But remember the Due only has SPI pins on the ISP connector in the middle of the board, not on 11-12-13 like most other Arduinos.
Or 50,51,52 on the Mega, but none of this is relevant. he asked about SPI on the DUE!!!
Regards,
Graham
The SPI pins on the Due can be accessed as MorganS described.
MISO = D74
MOSI = D75
SCK = D76
void setup() {
Serial.begin(115200);
Serial.println(MISO);
Serial.println(MOSI);
Serial.println(SCK);
}
void loop() {
}