Can I use the Photon to drive an SPI display?

Hi Carloop community!

I’d like to use a Carloop & Photon to make a custom display for my Link G4+ ecu. Very specifically I’d like to know if I can still use SPI with the Photon while the Carloop is installed so I can display via a couple of: OLED Breakout Board - 16-bit Color 1.5 w/microSD holder [EYESPI Connector] : ID 1431 : $39.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Any examples of something similar? Hopefully I can get my corporate overlords to allow me to open source my efforts once ready for general consumption.

Hi @WarriorOfWire,

I have had some ideas for using a Photon with Carloop and other devices, but have not had the chance to do anything along these lines yet.

For SPI, the Photon has hardware support for SPI on the sets of pins in the Photon documents here:
https://docs.particle.io/reference/firmware/photon/#spi

That part was easy enough to find. The next part is the Carloop design, which is not quite so easy to find, but is on GitHub here:

In comparing the two, the pins for the ‘SPI’ Object are A2-A5 and are not used by Carloop. These pins are all available and you can use it to do SPI, so this should be quite easy.

Looking more closely, there is a design in work for a CarloopXL, which uses SPI for a SD Card. If that design eventually comes out, you would have to use multiple chip select lines (SPI-SS) for each device, such as A2 already used for the SD Card, plus some other available pin (D6 maybe to select your SPI display device).

One thing to keep in mind with your design is the performance. You will need to experiment to see how busy the Photon is taking care of the CANbus and the SPI to see if the performance is fast enough. It may be okay. If you are looking at performance issues, using CAN filters (see the Photon documentation) can help reduce the Photon workload in taking care of the CANbus.

Let us know how your project goes!

1 Like

Just for Future Googler:

I was successful in using an Adafruit 1.5" OLED display via SPI. It was good enough that I have since moved on to a 4d Systems 7" display, connected via Serial1 (hope I never need gps…). Performance of this configuration is not as it needs to be, but it has less to do with the data interface and more to do with how the screen’s messaging is implemented: You have to wait for the screen to send back an ACK byte, which takes 25-32 milliseconds per widget with no bulk/batch update API. I’m still working with them to try to find a higher refresh rate option, as I’d like 6-8 visualizations with smooth animation, and it’s visibly choppy just with 4.

The Photon is an outstanding piece of hardware, and I’m even driving the non-touch “SuperBright” 7" display straight from the vIN pin on the Photon. Can’t wait to resolve the performance issue and get this thing in my dashboard!

1 Like

On the particle forums, there are threads on the topic of using 4D displays. I think peekay123 is one of the experts there.
Take a look among these postings to see if you can improve the performance of your display:

Well, after writing a new display stack, a new 4d systems library and several python programs for post-processing images & metadata we have a complete Carloop integration with a Link ECU in a 1987 Toyota MR2. It’s smooth enough for me :slight_smile:

2 Likes

Very cool! Do you have pics of how you wired it all together?

Most of the integration is under a dashboard, really difficult to photograph. I packaged the Photon and Carloop into a plug-in box though, maybe that’s interesting? I would have loved to have just holes rather than an OBD2 connector, as I could have made the same thing more compact and with 1 connector rather than 2.

Very cool! I love how you did the display.

I am also surprised that a 1987 car uses CAN bus.

Very high-tech for a car of that vintage.

Well, I had to add that. I rewired the engine to use a Link G4+ Monsoon and programmed the CAN messages to ship all that data and lots more up front. It’s a little more technical than when it rolled off the line 3 decades ago!

In that case: Wow! That is impressive.