Pi-Pico and Pico-Unicorn 7x16 RGB LED Display

Hi Everyone…
The new Pi-Pico from Raspberry Pi has re-sparked my interest in hobby electronics - and with it a learning curve into Raspberry Pi OS Linux, Micro-Python and the Pi-Pico (where in a previous life I was using 8051 ‘C’ & Assembler with windows based tools!).

So I have just invested my pocket money into a Pi 400 and a Pi-Pico from Pimoroni and in a few hours I managed to Blink the pin 25 LED.

My next goal is to drive a Pico-Unicorn 7x16 RGB LED display, but beyond using the Pimoroni Pico GitHub libraries and just doing a cut-n-paste of the relevant functions - I feel as if I am missing a large part of what is happening “under the bonnet/hood” as to how the code works.

Is there more “How to” detail available/planned (such as a data-sheet/Schematic), or, does anyone else have a Pico-Unicorn (or maybe the Pi-4 Pi-Zero Unicorn Hat/PHat’s) and maybe happy to share their knowledge in some way.

Thank You

Unfortunately Pimoroni don’t usually release schematics.

The Unicorn boards can work slightly differently, but usually the deal is that the host board (Pico or Pi) can’t provide or sink enough current to drive all of the LEDs itself, and sometimes doesn’t have enough pins to do it either. So, there’s some sort of chip(s) - either one designed specifically for controlling LEDs or a microcontroller which is better suited for it - on the back of the board. The host board sends red, green and blue values to the controller chips, and the controller chips use that to drive the LEDs.

You’d need to check how it is set up on the Pico, but I’m fairly sure the Pi boards use the SPI interface because it is fast and can push data for a lot of LEDs really quickly. So it sends the red, green and blue values for each LED, one after the other, the control chip reads that data and uses it to set the brightness of each element inside the LED.

1 Like

I have the Unicorn HD and Unicorn Mini, they both use SPI.
A lot of the code is R,G,B. 0 is off, 255 is full bright.
255, 255, 255 is white for example.
255, 0, 0 is Red
0, 255, 0 is Green
0, 0, 255 is Blue.

Colors RGB (w3schools.com)

1 Like

I do believe the Unicorn Hat and pHat (not HD) use Neopixel like code. They have just the one data pin in, in use.

1 Like

Thank you for the replies so far “shoe” & “alphanumeric”
I had noticed that no schematics show up in any search on the topic - which I can understand from one view, but some form of “Programmers Block Diagram” as an alternative would make things a little easier…

It might be I have not found the correct web page yet (?) - but simple things things appear not to be defined - such as:

“Row” and “Column” orientation for the board - Portrait or Landscape?
Which LED is at x,y=0,0? Top Left, Bottom Left?
Does the board latch the data, or does it have to be constantly refreshed (or is refreshed by the Pico PIO code)?

There is pico-unicorn pin-out diagram on the product page that gives a top level view and a short text description.

I goofed in my other post I have a Display pack not the Unicorn on the way. I flipped a coin at the last minute and went with the Display Pack that does use SPI

The Pico Unicorn doesn’t use SPI as near as I can tell. I saw the following on the product page.

Pico Unicorn Pack drives its display via the PIO feature of the RP2040.

The display is updated one row at a time (but very quickly, so you won’t notice!) by selecting one of the SR17 pins which control the row driving FETs.

Column data is fed into shift registers via SIN / SCLK and then LATCH ed to hold during display. BLANK enables the column driving FETs to turn on the LEDs and produce the image.

The four switches are wired up as SW_A , SW_B, SW_X , and SW_Y .

Power is supplied through VSYS meaning that you can use Pico Scroll Pack both on USB power and from external supplies (so long as they can supply 3V+) making it ideal for battery powered projects.

1 Like

Row” and “Column” orientation for the board - Portrait or Landscape?
Which LED is at x,y=0,0? Top Left, Bottom Left?
Does the board latch the data, or does it have to be constantly refreshed (or is refreshed by the Pico PIO code)?

I don’t have one of the boards but knowing Pimoroni, it’s landscape with the LED next to the A button at the top left. From what @Alphanumeric said, it sounds like it latches.

Interesting that they went with PIO over SPI, I wonder what difference that really makes.

Thank you…
Having watched a YouTube interview with James Adams chief architect of the RP2040, since I posted my queries - using PIO allows the state machines to drive the required pins, without using either of the main processor cores (Wow!)

My question is can you use the Pi Pico with the Unicorn Hat Mini (also Unicron Hat HD, original Unicron Hat, Unicorn pHat and the Blinkt)?

The Pinout for the Pico is different from the Pi GPIO Socket, so one would have to use some form of cable to attach to the correct pins…
Plus, the Pico is 3V3 and the HAT/pHAT Unicorn boards are 5V (?)
(You would need to check)

Plus, the Pico is 3V3 and the HAT/pHAT Unicorn boards are 5V (?)

GPIO pins on the Pi are 3v3, so that should be fine.

On a technical level there’s no reason why it shouldn’t work if you have a decent enough power suppy from the USB, it’s just two SPI devices, but you’d need to write the library for it.

OK - Based on the various replies (Thank You) - And using the Pico-Unicorn demo.py on GitHub as a starting point…

Generated horizontal rows of the expected colours

Pico-Unicorn_RGBCMYW

One way to do it would be to mount your Pi Hat or pHat on a Mini Black Hat Hacker. Then use male to female jumpers from where the ribbon cable would go to a solderless breadboard with the PICO plugged into it. Feed your +5V in from there to the Hat. All you need to from the PICO is a common ground and your various signal / data lines.

@Victor_UK Thanks for the info and diagrams on the PICO Unicorn.
I have a Unicorn HD (two actually) and a Unicorn Mini HD. I’ve had a lot of fun with those.

An alternative method of setting each LED on the Pico-Unicorn to a given Colour using a Look-up Table…
Unicorn_Test_Table.py

[Edit: As noted by @alphanumeric (thank you)
comment on line 19 should read “Set all LEDs to White”]

Shouldn’t the clear the display be (x, y, 0, 0, 0)?
0 is off 255, 255, 255 is I believe white.

Ooops, Sorry, My Bad - Forgot to change the comment to “Set to all white”

Figured it was something like that, been there done that. ;)

Hi, I’m also planning on connecting the ‘unicorn hat mini’ to a Pi Pico. However, I can’t really understand from this post how you did the mapping from the Pico pins to the ‘unicorn hat mini’ pins. Can you explain that?

@michelvd Unless your doing something fancy / remote mounted? Just plug it in and run the installer etc.