Raspberry Pi GPI pins and encoders

Oh yes it does. Where even was a special preset in the code known as prototype-kees in the beginning, which was based on the 23008.

Are you really sure? Perhaps if you config the MCP23008 like a MCP23017 and you don’t use the second bank. I never tried…

1 Like

… but Jofemodo, in my first homebuilt Zynthian, I mounted this IC and it works from the first start up…

1 Like

OK. Then, most probably, zyncore lib is managing the chip as a MCP23017, using only the first bank.

1 Like

I solved… this P3 B+ raspberry I had used for a thousand projects and probably there are some pins that don’t work… I swapped it with a P3 B+ that I used for Kodi which is even more recent… now it works all with the encoders connected directly to the GPIO… The damaged one for Kodi is fine…
Thank you

3 Likes

:wink:

1 Like

3D printer?.. But I think you use wood which is much nicer :heartbeat:

1 Like

A friend gave me this chip already packaged (MCP23017)… I need confirmation …
PA0… PA7 = 100… 107
PB0… PB7 = 108… 115
… and the three switches ON?
Many thanks

The DIP switches always confuse me. They often have an “ON” indication that when the switch is pushed that way, disconnects the circuit. You can either test the switch with a multimeter or simply connect the device to the I2C bus and detect its address when the switches are in any / each position. I would do that. I gives confirmation the chip is accessible on the I2C address you want to use.

PA0-PA7 are the GPI on port A so will be the first 8 pins configured in webconf. Similarly PB0-PB7 are the GPI on port B hence the next 8 pins configured in webconf. The V4 config assigns these to GPI 100-115 but you can configure in the Hardware->Wiring page of webconf.

2 Likes

Perfect @riban.
Many thanks

HELP!!!
The MCP doesn’t work! I am attaching the links and Webconf settings.
Thanks to anyone who helps me…


You have written INT1-4. What are they?

Definitely had to be 3.3V, not 5V else you may damage the Raspberry Pi.

Thanks Riban
The INT1-4 are the buttons of the encoders…
The board is powered at 3.3V

Is there a way to see in the terminal what the card is doing on the SDA and SCL pins?
The expander’s SDA pin goes to the Raspberry’s SDA pin
and the SCL pin goes to the SCL pin of the Raspberry ? Right? They are not like TX and RX which sometimes need to be reversed…

No, SDA is a 1 wire data bus and SCK is the clock that any bus controller may drive so you always connect SDA to SDA and connect SCK to SCK.

It looks like your switches are reversed. You show INT 4 connected to PA0 but configure the first switch as GPI 100 which works be PA 0.

1 Like

Yes, this thing is already in place. However when I update the pins on webconf, on restart it hangs on the “Restoring state” screen and doesn’t go further… I assume therefore that the pin update doesn’t happen…

What does the log say?

Dog goes “woof”
Cat goes “meow”
Bird goes “tweet”
And mouse goes “squeek”
Cow goes “moo”
Frog goes “croak”
And the elephant goes “toot”
Ducks say “quack”
And fish go “blub”
And the seal goes “ow ow ow”
But there’s one sound
That no one knows
What does the log say?

2 Likes

I put everything here:

The log in that thread just shows xruns. We need to see the useful bit like the start.

1 Like

Sorry Riban… can you see from the log if the SDL port is working? Because with the new MCP23017 card nothing worked and now it doesn’t work anymore even with MCP 23008 which worked before. I had to hook everything up to the GPIO…