# Photon 2 / P2 & RGBmatrixPanel

**URL:** <https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581>\
**Category:** Libraries\
**Tags:** photon2\
**Created:** [September 15, 2024, 6:53pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581 "2024-09-15T18:53:31Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 15, 2024, 6:53pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/1 "2024-09-15T18:53:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [September 15, 2024, 7:41pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/2 "2024-09-15T19:41:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 15, 2024, 8:16pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/3 "2024-09-15T20:16:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [September 15, 2024, 8:41pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/4 "2024-09-15T20:41:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 16, 2024, 6:27pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/5 "2024-09-16T18:27:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 16, 2024, 6:35pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/6 "2024-09-16T18:35:53Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 16, 2024, 8:10pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/7 "2024-09-16T20:10:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 16, 2024, 9:03pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/8 "2024-09-16T21:03:57Z")

</div>

@rickkas7? I’m not sure if this possible on the P2.

---

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 17, 2024, 12:50pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/9 "2024-09-17T12:50:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [September 17, 2024, 1:20pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/10 "2024-09-17T13:20:41Z")

</div>

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.~~

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 17, 2024, 1:28pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/11 "2024-09-17T13:28:23Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 17, 2024, 2:59pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/12 "2024-09-17T14:59:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 17, 2024, 3:42pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/13 "2024-09-17T15:42:06Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ninja118](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@ninja118](https://community.particle.io/u/ninja118)\
**Post date:** [September 26, 2024, 12:37pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/14 "2024-09-26T12:37:41Z")

</div>

Thanks @peekay123, appreciate the feedback.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/3/2/3291e3c9351789fe8620ae5bcec8d3fec67ff221.png) [@system](https://community.particle.io/u/system)\
**Post date:** [November 25, 2024, 12:37pm UTC](https://community.particle.io/t/photon-2-p2-rgbmatrixpanel/67581/15 "2024-11-25T12:37:50Z")

</div>

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