Close

Hyperpixel 4 Warning

A project log for openSampler

a hardware sampler based on the raspberry pi running bare metal (so no Linux)

nick-verlindenNick Verlinden 09/30/2020 at 20:031 Comment

Short warning for all those who are interested in using the HyperPixel 4.0 Square display: it uses ALL the GPIO pins. In my experience not even the UART is accessible anymore. That's a no-go for openSampler, but I still want to use this display because the dimensions are absolutely perfect. I'm thinking about using the pi zero to drive the display, and let the pi 4 (or the cm4 when it comes out) send display commands over i2c to the pi zero. This way I can also use the display with any MCU that can talk i2c, such as the esp32. I'm not the first one to do such a thing, as far as I know, NerdSeq also uses the pi zero to drive a display.

For those who also want the use this display in bare metal; you need to add some lines to the config.txt, and add the hyperpixel4.dtbo file to the overlays directory on the boot volume. This file needs to be built by the install script. They used to have a compiled version in their github repo, but it's gone. I don't know why though, I 'compiled' it on a Pi 4, and tested it by using the same sd card in a pi zero and it worked without modification. If you need it, you can find my compiled version here: 'https://gitlab.com/nickverlinden/hyperpixel4-baremetal/-/blob/master/doc/pios-files/pi4b/boot/overlays/hyperpixel4.dtbo'. You also need to do some display init code in your project. The code can be found in this file: 'https://github.com/pimoroni/hyperpixel4/blob/square/src/hyperpixel4-init.c'. You need to do some rewriting so that it uses circle's GPIO functions. The code basically bit bangs some display init commands over one of the GPIO pins. I think it's a little weird because it looks like it's some sort of SPI, so I don't know why they just didn't use the SPI bus. If someone knows, shout it out in the comments please. 

This is the output of the install script from hyperpixel, all the lines added to config.txt are of interest:

Config: Added dtoverlay=hyperpixel4 to /boot/config.txt
Config: Added overscan_left=0 to /boot/config.txt
Config: Added overscan_right=0 to /boot/config.txt
Config: Added overscan_top=0 to /boot/config.txt
Config: Added overscan_bottom=0 to /boot/config.txt
Config: Added framebuffer_width=720 to /boot/config.txt
Config: Uncommented framebuffer_height=720 in /boot/config.txt
Config: Added enable_dpi_lcd=1 to /boot/config.txt
Config: Added display_default_lcd=1 to /boot/config.txt
Config: Added dpi_group=2 to /boot/config.txt
Config: Added dpi_mode=87 to /boot/config.txt
Config: Added dpi_output_format=0x7f226 to /boot/config.txt
Config: Added hdmi_timings=720 0 15 15 15 720 0 10 10 10 0 0 0 60 0 35113500 6 to /boot/config.txt

Discussions

Robo-Fortune wrote 12/02/2022 at 02:59 point

Thank you so much for writing this, it's been a huge help getting my current project going in the right direction. Just to confirm, does one put a line in the cmdline.txt file to run a compiled form of the modified hyperpixel4-init.c file on boot in order to get the display working? I'm currently trying to use it essentially as a monitor for a desktop using a non-linux OS (9front) on a pi 3B+. Thanks for reading, hope your day's going well!

  Are you sure? yes | no