Photon 2 / P2 & RGBmatrixPanel

My understanding is that the RGBmatrixPanel library is not currently supported on P2 / Photon 2 due to a dependency on the SparkIntervalTimer library, which depends on hardware interrupts and is not "currently" supported on the P2 / Photon 2.

Is there any hope of getting RGBmatrixPanel supported specifically on the P2 / Photon 2 at some point? Or can this never happen due to hardware limitations of the P2 / Photon 2?

It's theoretically possible but unlikely. The GPIO on the RTL872x is too slow to bit-bang the matrix protocol, independent of the SparkIntervalTimer issue.

It's possible to do it using the SPI peripheral, which is how the NeoPixel library is implemented, but it would be a change that would require major modifications to the RGBmatrixPanel library.

Interesting. So, the CPU has a faster clock speed (200Mhz) than the P1, but the GPIO support is slower?

Correct. It's weird and annoying. If I recall correctly direct GPIO access is gated by a 32 KHz clock, and various other limitations prevent toggling GPIO even at that rate.

When you use the RTL872x SPI peripheral (for non-SPI) you can toggle GPIO at MHz rates but it requires a lot more effort to set up the DMA buffers.

There's a somewhat related problem on the nRF52 though the problem is interrupt latency, not slow GPIO. But in any case, a number of libraries including NeoPixel use DMA on that platform as well.

STM32 has awesome fast GPIO access speeds and low interrupt latency, but was impossible to source during the chip shortage.

1 Like

Thanks for this insight.

@peekay123 any hope of you working up support for RGBmatrixPanel on P2 / Photon 2 via SPI and DMA or any other technique?

@ninja118, I have looked at the possibility of porting to DMA but it would a) need a timer triggered DMA transfer and b) likely extra hardware to drive the display. The P2 is really not a good candidate for this application I fear.

If the extra hardware were available, is the timer triggered DMA transfer something that is possible on the P2?

@rickkas7? Iā€™m not sure if this possible on the P2.

Is the Particle M-SoM in any better position to make this work, or does its RTL8722DM have the same GPIO speed limitations?

Or are there any other current Particle products where this could be possible?

The M-SoM will have the same limitations as the P2/Photon 2 as it's nearly the same processor, just more GPIO, but same speed.

Since the Argon is discontinued there isn't a Wi-Fi device that would work. If cellular is a possibility, then the Boron or B-SoM (nRF52840 MCU) would work.

@rickkas7, @ninja118, the bit-banged RGBMatrix library requires timing and GPIO speed that is not available on either the Argon or the Boron, B-SoM or M-SoM. Using timer driven DMA with external hardware may be possible on the nRF52840-based devices but it has never been implemented or tested.

What size RGB display did you want to drive and at what refresh rate?

Looking to drive 32x128 at the same refresh rate (ideally higher) than was possible with P1.

@ninja118, your best approach may be to use a separate MCU (e.g. ESP32 or STM32) to drive the panel(s) which would do the heavy lifting of driving the displays, much like an HMI. You would need to have a serial or other interface to the Photon2/P2 that accepts high-level display commands. You could also render a display buffer on the Photon2/P2 and use SPI to transfer the display "buffer" data to the display MCU.

In the latter scenario, the refresh rate of the display would be affected by a) the display MCU display update performance and b) the speed at which a display buffer can be transferred from the Photon2/P2 to the display MCU.

Thanks @peekay123, appreciate the feedback.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.