I'm working on a project for a motorcycle. The idea is to read data like speed and RPM on the bike's CAN-bus and display them on a graphic display.
I have the following hardware:
Arduino Uno R3
Newhaven FT81X shield
Newhaven 7 inch display with EVE2
Seeed CAN-bus shield V2
The libraries I use are GD3 for the display and mcp_can for the CAN-bus shield. Arduino is 1.8.10
I have gotten the display and the CAN-bus shield up and running separately. However, I get into problems when I run both of them at the same time. I have to put in delays in the loop after reading CAN data to avoid that the display crashes. And with the delays, the display flickers everytime I do a display update, GD.swap().
I have started to wonder if running both shields at the same time is too much for the Arduino Uno, but that doesn't really make sense to me.
Anyone have experience with these shields or general comments or ideas?
mikb55:
The two shields are not compatible due to pin conflicts.
The Newhaven shield uses a pin that the CAN shield wants to use for CS.
The solution will involve modifying the CAN shield and changing the code.
Thank you for your quick response.
I have already taken care of this. I have cut the track to pin 9 on the CAN-bus shield and connected it to pin 4 instead. I have also updated the pin assignment in the code. This seems to work correctly.
After searching a lot of websites and web forums, I concluded that the problem most probably was related to the SPI-bus implementation in the different libraries. So I tried to run the display without the Gameduino (GD3) library.
Using the FT-library from FTDI/Bridgetek is hard compared to GD3, but I was finally able to draw something on the display. And then copy-paste some of the CAN-bus code from the Seeed library and get it all up and running. So now I can draw on the display without adding any delays in the loop, and at the same time receive CAN-messages. Have tested up to 100 messages per second. There's no flickering on the display and no bluescreen.