Dear reader,
I have used the forum in the past by reading the problems others face and the solutions given. This time I am facing a challenge where I need some help and would like to contribute.
Problem: Two SPI devices SSD1351 and MCP2515 with separate CS pins. Can communicate separately, but together the display doesn't show animations.
Hardware: My own custom PCB for Arduino Nano Every, MCP2515 and a Waveshare 1.5" OLED display. I have/will attach some pictures if the electrical schematic.
Software libraries: Adafruit SSD_1351 v1.3.0 and Milesfrankland edit of autowp CAN bus library. IDE 2.1.0
Communication: 4 wire SPI with separated CS for MCP2515 and display.
For explaining my problem, I will combine the "CAN_read" example in to the SSD3151 "test" example. Only things changed are the SPI pin defines and baudrate.
test.ino (8,7 KB)
I attached the test script in the attachments. Procedure for problem reproducing.
- Successfully SSD_1351 test example (vanilla) with my SPI pins.
- Successfully SSD_1351 test example with my SPI pins and only including the CAN-Bus library and “struct can_frame canMsg;” and “MCP2515 mcp2515(9); // CAN controller CS pin on D9”.
- Failed to run code when including (uncomment) all the MCP can_read example in setup.
When introducing the “mcp2515.begin()” the display is not functioning as it should. The display remains black or frozen from the last shown animation when it did work. But if I include Serial.Println(“ ”) pings in the code. The Arduino does go with the expected pace through the code. I say this specifically, because I used the SeedStudio MCP2515 library in the past and then it shows all the Serial.Println(“ ”) pings within a second. So I changed to the autowp library.
What I tried on HW level
- Double check Nano Every PCB footprint with the Nano Every pinout and script pin #DEFINE's.
- Solder 10k pullup resistors to both CS pins
- Cut the MISO trace and add a 5V tri state buffer SN74HCT125N. This also did not help (display showed white noise), but maybe because I was not able to get the SN74HC125N (2 V to 6 V) (non T version).
I was digging in both libraries .h and .cpp and I saw different SPI bus speeds being mentioned.
SSD_1351 .cpp:
#define SPI_DEFAULT_FREQ 8000000 ///< SPI default frequency
autoWP .h:
static const uint32_t SPI_CLOCK = 10000000; // 10MHz
But I was not able to successfully change the Milesfrankland library to 8 MHz.
CAN Somebody help me track down the cause and solution of this problem?

