MCP23017 recognized but doesn't work

Hello everybody,
new day, new problem…
I’ve bought a mcp23017 board and after shorting address resistors I have it recognized at 0x20, but whatever I connect to it (a simple momentary switch as reference), it doesn’t affect the ui.
I’m powering the mcp board with 3,3V

One of the pin of my switch is connected to PA0 and the other one to GND

can you help me to figure it out how to solve this problem?

thank you in advance for your precious support <3

here follows some screen and pics
image

my layout

wiring and connections


terminal gpio readall
image

terminal i2cdetect -y 1
image

terminal i2cdetect - l
image

You proved the i2c channel as you, no doubt, realise.

GPA & B 6 & 7 should actually do zynthian type things.

This is the allinone board schematic and it appears you are connecting one of the encoder pins which might well mean you wouldn’t see any actual effect…

many thanks, I just switched to this configuration and it worked

I have a doubt about push/release actions, if I select push it triggers not depending on the duration of the “click”, instead, if I select release it works in a strange way, not depending on the duration but on the number of clicks in sequence, is this normal?

thank you for the support, I should send you a beer wherever you are

You are unlikely to get the correct setting by trial and error.

You have to be very ordered in adjusting these configs. I tended to just connect one encoder. The Select encoder is the best one to start with. And start by making sure you could successfully detect the Select encoder being pressed. Then get the encoder it’self working, by connecting the PIN-a and pinb settings. Again I can’t remember where it sits in the order so you will have to work this out. You can put a value of 0 as a placeholder…
I don’t remember exactly which pin coincides with which number value, but I think its

PA0 - 100
PA1 - 101
PA7 - 107
PB0 - 108
PB7 - 115

https://wiki.zynthian.org/index.php/Web_Configuration_User_Guide#Wiring_Layout

details 4 encoders and 4 s1-s4 switches

Sounds a bit like it’s trying to be an encoder. If you have selected a press pin in the mapping ( the numbers in the text boxes in webconf) and it’s expecting an encoder such things could happen.
Work them out carefully, one by one, and when you have done it and it all works.

WRITE THE CONFIG DOWN!

because if you burn a new ssd you will have to put them in again and it’s a right pain working them out from scratch if you hadn’t written them down.

1 Like

I didn’t mention that I obviously wired the switch to pb7- 115 as you suggested

Do you get the basic idea of how the number relate to the functionality?

The four encoders are the taken in turn on the text boxes on the webconf display. It may seem a little contrived but it date back to the original days when this was all handled on GPIO pins and the i2c 23017 was an addition to deal with running out of pins.

It’s probably a good time to show the encoders and post some photos and how they are wired to the board. There are differnet types of encoder wirings that have confused things in the past.

Hello again,
I managed to make the 4 encoders(+ their switches) working, and also 4 additional switches wired directly to the gpio.
now i’m trying to add more switches (my gpio is pretty empty and there are some free pins on the mcp23017 board) without success

probably the zynaptik config doesn’t help me in any way, because switches pins after the 8th aren’t recognized and I don’t know how to set up more simple switches

do you have any advice or suggestion?

thank you in advance

1 Like

Hi @bigtower17 !

I just increased the limit to 12 custom switches (16 switches total, accounting the 4 encoder’s switches).
Are you using “oram” branch? If not, you should start using it because this change is not going to be in stable for a time.

Once you have oram branch updated to the last, you have to add your switches pins and save. Then the needed configuration rows will be added to the list.

Please, be aware that we will cease to support oram 32 bits very soon and we will ask everybody using oram branch to start using the 64 bits image. This will happen in the next few days.

Enjoy!

1 Like

Thank you!
My red thing will benefit of this upgrade

5 Likes

Ohhhh! This is a beauty, @bigtower17 !!! :heart_eyes:
Send some noize if you get bored …

@jofemodo I’ve just updated my branches and added pins and actions but now no one of the switches work, apart from those of the encoders. is there anything I have to change in my settings?

What numbering are you using for RBPi pins? You should be using wring pi numbering.

Regards

I’m using wiring pi numbers, as it was before the branch update

OK! Could you try to put before the remaining MCP23017 pins? Just to check …

I’ve just tried but nothing changes

edit:
@jofemodo going back to stable, without changing anything in the wiring settings, it works with 4 switches as usual

Hi @bigtower17 !

I just checked and i managed to configure 4 custom switches (8 switches total) with my latest changes in oram. I couldn’t test with more than 8, but it should work with 8 at less. BTW, i tested with MCP23017 pins.

Regards,

1 Like