My Hybrid Pi5 DIY Zynthian experiment

When selecting “MPC23017 Extra” wiring layout, I am able to select "MCP23017 INT-A Pin " and “MCP23017 INT-B Pin”.

yeas, me too, but for pin 36 and 37 there is only one possible GPIO config avail…
and none of those corresponds to GPIO 16, 26 as indicated in the Slim hat paper.
Which by the way it’s not even sure it has been written with Pi5 config in mind.

Here is my pinctrl output.

here it seems GPIO 0,1 is being used by ID_SDA and GPIO 25-27 by none,

in Wiring config I see no option avail to point INT to those pins…
maybe I should tell raspi to use other pins for interrupts?
not sure what to do here…

And here seems encoders pins 101 and 102 are being used by something already…
these should be assigned to enc 1? (Althought I might want to change the order so it would work as encoder 4).

The raspbery Pi 5 has a complete new pin nummering.

GPIO 26 (pin 37) on the Pi4 is mapped to pin nummer GPIO 425 on the pi5
(See file /sys/kernel/debug/gpio)

The GPIO hardware limits thist number:

#define GPIO_PIN_MIN		0
#define GPIO_PIN_MAX		31

Max on the Pi5 is 511.
Can this number be increased to 511?

This are the pins used by the Pi52 hybrid PCie Nvme+DAC

[Pin 23] GPIO 11 EP-0218 DAC+ NVME
[Pin 35] GPIO 19 EP-0218 DAC+ NVME
[Pin 38] GPIO 20 EP-0218 DAC+ AUDIO
[Pin 40] GPIO 21 EP-0218 DAC+ AUDIO

Hi @bambalaya!

You have posed in may threads regarding your issues with building your “hybrid Pi5” zynthian, mostly relevant but often with duplcate or overlapping content. I have read all of these posts and tried to respond to many of them. I have come to the conclusion that most of the issues you are experiencing are due to the use of a breakout board / hat that seems to have not yet been used by zynthian builders. It may be more approrpriate to concentrate on that board in a single thread, e.g. this one. In that way you can stay focused on the topic of resolving issues with integrating that board and we get a more contained history and hopefully resolution of these issues which can help inform other builders considering using this board.

I understand that you are using the “Domoshop SLIM Midi” which I think is this board. (I didn’t find a link in your posts but a partial screenshot of a website you posted pointed me towards this as the most likely candidate.) You seem to have been installing modules to get this to work but, in theory it should be able to work with zynthian without any extra software. You have identified that the board has its interrupts hardwired to pins 36 & 37 (although I haven’t found that web page) and you suggest that zynthian webconf does not support that, but it does:

So you should be able to get the 16 GPI working which can serve the 4 encoders (8 GPI) and their switches (4 GPI) plus another 4 switches, e.g. S1…S4.

The MIDI should also work with zynthian vangelis branch which implements the correct RPi5 overlay for the USART pins used by this board. I see it has TRS MIDI outlets and does not include the cables. Are you sure that you have broken these out to the right pins on the DIN-5? There are two wiring conventions.

Of course, you are trail blazing here and, having chosen a device that no one has previously used (or at least, not documented) you have taken on the risk, and responsibility for working out how to make this work. You will get limited support from the community (if you are kind and pose questions that users can understand and know how to help with) but if no one else has this board, they have limits to how much help they can provide. We love that users are brave and try to make more stuff work with zynthian but there is a limit to how much we can help those adventurers!

[Edit] I can’t see on the website what the base address for the MCP23017 is but your screenshot of that eliusive page shows 0x21, so I would suggest starting by selecting Wiring Layout: “MCP23017 Encoders” and changing the "MCP23017 I2C Address " setting to 0X21. The rest of the settings look okay and you should have 4 encoders configured. You would then connect your first encoder swtich between GND and the first GPI on the hat, the outer two pins of the encoder to the next two GPI on the hat and GND to the centre pin of the encoder. Ideally, add a 10nF capacitor between each encoder pin and GND. This should get you a working encoder.

The MIDI should just work!

3 Likes

That is exactly what I did.

Xternal TRS to Midi HAt connection have been checked with tester and are 100% ok.
I tried to plug midi directly into the hat anyway each time just to double check.
As you said, the first Gpio breakout I assigned to the SW of the ENC and the other two to A and B of the same enc.

Also ENC cable connectors have been checked three times with a tester.
I’m super-cautios when doing these jobs and before even providing power
I always triple check everything

Have you managed to get that hat working with another OS on the RPi5 following the manufacturer’s instructions?

I managed to install the ttymidi libraries from Idrolez, the maker of the Slim Midi Hat and Maintainer of the github ttymidi libd, with some hacking jumps here and there.

But it’s not working. Not the midi, not the encoder.
I think I only managed to install lgpio, that is why I can do pinctrl.
Gpiozero and all the others, like GPIO.rpi, not a chance.

here is the Raspi thread for my Hybrid Zin
https://forums.raspberrypi.com/viewtopic.php?t=388286

Here is the more general tty midi not working thread
https://forums.raspberrypi.com/viewtopic.php?p=2321048&hilit=ttymidi&sid=4fa9a75bccd4a900d958e936aab5013c#p2321048

This sounds rather like a local issue. Zynthian has tty-midi working on RPi5. Zynthian has MCP23017 working on RPi5.

1 Like

I could try take away the pi52 DAC… and try connecting only the Slim midi hat, to see
if thtt makes any difference… let me try this now…

I connected my jetli usb sinilink soundcsrd but it is not bein grecognised. It is recognised automatically in Pi os. No more pi52 hubrid nvme da. Still no midi in. I set audio to dummy.

this is the siniilink usb card
https://forums.raspberrypi.com/viewtopic.php?t=387665

I re-edited all rasp forum posts saying Zynthian has MIDI DIN working, and suggested
rpi-devs to take a peep at Vangelis testing and see if there is something they can
do to implement some better fix for bookworm MIDI DIN.

It’s really strange that I can’t get MIDI DIN working on Vangelis testing.
Maybe I screwed some raspi-config outside the control of Zynthian?

Also when leaving Encoders extra with all numbers and switches the log gives no errors, If I change any to -1 weblog return errors. Maybe my encoder is a bit lame…
Rolfdegen changed it for a PEC11R, this I’m using is the old one, that was skipping when
moving fast… should I buy Zynthian 4 encoders pack???

I can see only the silicone pad. Do you think I’d be able to install it???
Which kind of Encoders would you suggest?? PEC11R is really expansive…
I saw some 4 encoders in lane on a single PCB somewhere but can’t find the link.

Or 4 encoders and 4 switches

To be clear, @bambalaya, MIDI DIN-5 works in zynthian because it also works in RBPI OS. We simply use what they have released in the base OS. We are not doing anything special here.

If you can’t get it to work in RBPi OS nor Zynthian, then i must suppose the problem is your setup. So, re-check everything, because you are missing something important for sure.

The same would apply for the encoders. I would recommend you to stick to someone else setup, using the same parts and config. It’s easier to modify something that already works that engeneering and building from scratch.

All the best,

3 Likes

I’m checking with the scope the Midi in signal from the SQ64.

Version is Vangelis testing
zyncoder: vangelis (e903d39)
zynthian-ui: vangelis (6f4bc09)
zynthian-sys: vangelis (eac724c)
zynthian-data: vangelis (d2f62e0)
zynthian-webconf: vangelis (64b7f89)

in options i have

dtoverlay=miniuart-bt
dtoverlay=midi-uart0

nano /boot/firmware/config.txt

http://rptl.io/configtxt

Some settings may impact device functionality. See link above for details

Additional overlays and parameters are documented

/boot/firmware/overlays/README

Automatically load overlays for detected DSI displays

display_auto_detect=1

Automatically load initramfs files, if found

auto_initramfs=1

Don’t have the firmware create an initial video= setting in cmdline.txt.

Use the kernel’s default instead.

disable_fw_kms_setup=1

Run in 64-bit mode

arm_64bit=1


It gets to the Slim midi Octocoupler in at 5v and it goes out also at 5v.
Checking pin 10 of the pin connector I get a 3.3v flat signal, without
any dips or ticks that were prior present.

The Encoder I have the SW pin connected to ground, and the other pin to
GPIO 100, on the 23017 breakout is pin Gpa0.
When checking the ground pin, and <i press the enc sw, it goes high.
the other pin connected to Gpa0 instead just stays high.
Maybe I have the enc connections inverted?

All 23017 pins are high when checked with nothing in
With the SW cable in and I press the SW, it just stay high…
I doesnt go down… the supposed GND pin of the enc instead goes high…

The pin 10 RX idem, it stays high at 3.3v, and I don’t understand why it doesn’t change
the slim probing seemed to be good the midi signal…