Dear All,
I'm totally new to SPI so apologies in advance.
I've tried and googled over a week now, bust can't get my Mega 2560 to talk to my 23S17 Expander via SPI an make a LED light up ![]()
I've wired the Arduino to the MCP23S17:
CLK:Mega 2560 (52) > MCP (12)
MISO: Mega 2560 (50) > MCP (14)
MOSI: Mega 2560 (51) > MCP (13)
CS/SS: Mega 2560 (53) > MCP (11)
GND: MCP/Vss (10), MCP/A0 (15), MCP/A1(16), MCP/A2(17)
V+ 3,3V: MCP/Vdd(9), MCP/Reset (18)
LED: MCP/GPB0 (1)
I'm using the 23S17.h Library from Cort Buffington.
And I tried to keep my code simple:
#include <SPI.h>
#include "MCP23S17.h"
#define SS 53
#define MISO 50
#define MOSI 51
#define SCK 52
// Cort Buffington
// https://github.com/n0mjs710/MCP23S17
MCP MCP_0(0,SS);
void setup() {
delay(1000);
Serial.begin(9600);
Serial.println("Startup");
MCP_0.begin();
MCP_0.pinMode(8,OUTPUT);
MCP_0.digitalWrite(8,HIGH);
Serial.println("Completed");
}
void loop() {
}
I'm debugging the SPI via oscilloscope and digital analyzer and from what I understand the MOSI looks ok (see MCP23S17_SPI.jpg)
I've checked the LED and swapped the MCP.
But simply have no clue on how to debug this any further.
Help greatly appreciated.
Thanks
Mike
