So I have tried to follow these instructions Building a custom Zynthian - ZynthianWiki and have not have any luck. I noticed each encoder in the picture has 5 cables coming from them instead of the 4 that were directed in the instructions. on my encoder the pin in that spot has a + symbol. so it has CLK, DT, SW, +, GND.
With the gnD my MCP only has 2 GND pins so I connected the others to GND pins on the Rasberry pi’s pins, is that correct?
I have followed all this:
"First we need to connect some PI GPIOs to the soldered board. We use the two 13-pin headers next to the MCP23017. Therefore we check the Pi GPIO pinouts.
Connections from PI GPIOs to MCP23017 board
| From Pi… (Physical Pin Number) |
5V (2) |
GND (6) |
SDA (3) |
SCL (5) |
GPIO (36) |
GPIO (37) |
| To MCP23017 |
VIN |
GND |
SDA |
SCL |
Int-A (IA) |
Int-B (IB) |
Now we connect the encoders to the respective pins, in that version labeled A0-A7; B0-B7. You can basically chose every combination (see section “wiring setup”), but we’ll use this, because it’s convenient for cable lead:
Connections from MCP board to encoders
| MCP23017 |
B4 |
B5 |
B6 |
B0 |
B1 |
B2 |
A4 |
A5 |
A6 |
A0 |
A1 |
A2 |
| Encoders |
Enc1 CLK |
Enc1 DT |
Enc1 SW |
Enc2 CLK |
Enc2 DT |
Enc2 SW |
Enc3 CLK |
Enc3 DT |
Enc3 SW |
Enc4 CLK |
Enc4 DT |
Enc4 SW |
Additionally we connect all encoder GND to the boards GND line, where we soldered the 4-pin header mentioned above. In picture 5 you see the second 4-pin header soldered to the 5V line already, where we connect the encoder “+” to 5V. Why is that?
I happened to have ordered encoders mounted on a PCB, don’t ask why. This includes 10kOhm pull-up resistors (don’t ask why). The two options were to desolder these resistors, cut their lines or just power the encoders. I chose the latter option. Without connecting them to 5V they actually worked, but very clumsy, unreliable and sometimes triggering other actions than intended.
5 Setup
The software sided setup of your hardware is typically done in Webconf. You may also feel like editing the file /zynthian/config/zynthian_envars.sh which is basically edited when you do changes in Webconf. The code snippets below are taken from that file for better readability. You may find the according Webconf page and settings very quickly. If you find a “\n” in these snippets, this expands to an EOL (line break).
5.1 Wiring setup
My wiring setup, which you may easily find also in your Webconf → Hardware → Wiring page looks like this:
# Zynthian Wiring Config
export ZYNTHIAN_WIRING_LAYOUT="MCP23017_ENCODERS_V5TOUCH"
export ZYNTHIAN_WIRING_ENCODER_A="112,108,104,100"
export ZYNTHIAN_WIRING_ENCODER_B="113,109,105,101"
export ZYNTHIAN_WIRING_SWITCHES="-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,114,110,106,102"
export ZYNTHIAN_WIRING_MCP23017_I2C_ADDRESS="0x20"
export ZYNTHIAN_WIRING_MCP23017_INTA_PIN="27"
export ZYNTHIAN_WIRING_MCP23017_INTB_PIN="25"
5.1.1 Wiring layout
We use MCP23017_ENCODERS_V5TOUCH because we have physical encoders, but no physical buttons, why we are using the virtual V5-onscreen buttons."
But I’m not sure what this is:
"5.1.2 Encoders
In Enc_A (CLK), Enc_B (DT) and Switches (SW) field you type in the numbers you chose when wiring the encoders to your MCP23017 circuit. Numbers between 100 and 115 are connected to the A0 to B7 pins like that: A0=100, A1=101, … B7=115. So your encoder4-CLK we connected to A0 (see table above) means, you’ll state it as 100 (=A0) on 4th position.
The bunch of 20 “-1” in the switches field represent the virtual buttons you’ll use if you use the touch or virtual V5-buttons setup. If you don’t have 20 physical buttons connected to match the V5 layout, just type it in like that.
5.1.3 MCP Adress
We soldered the adress pins all to GND, remember? This leads to adress 0x20, which has to be chosen in the corresponding field. If you add another MCP (for buttons or whatever) or you just feel to use another adress, you need to connect the adress pins in another fashion. Think binary numbers (D2; D1; D0):
--- > 0x20
--+ > 0x21
-+- > 0x22
...
+++ > 0x27
5.1.4 Int-A and B pins
We connected the IA and IB pins of the MCP to physical pins 36 and 37. If you look them up in the webconf menu, you can chose for example “WPi GPIO 27 (Pin 36)”, where pin 36 is the physical pin 36 (if you count on the hardware), and WPi GPIO 27 is the “WiringPi” number (not the GPIO 27). Check the pinout overview linked above: You’ll see that this Pin is actually GPIO 16. So why is the setup file storing it as “27” and “25”? It uses the WiringPi naming convention (see issue above).
To make things easier here: if you, like me, chose to use psysical pin 36 and 37, also chose that in the webconf menu."
it appears to be reasons for those settings.
I will send a picture from my phone of my wiring.
Honestly don’t know how to take a picture where the connections are clear