geekhack

geekhack Projects => Making Stuff Together! => Topic started by: tototoru on Sat, 03 March 2018, 12:07:20

Title: Teensy with an MCP23017
Post by: tototoru on Sat, 03 March 2018, 12:07:20
Hi,

I'm finally back to my custom keyboard project, I was planning to use an HDMI cable to not use any sort of expansion, but the Chinese HDMI cable has only 14 wires instead of 20, which isn't enough for my needs.

I have to add an IO expander, doing some research looks like the MCP23017 and MCP23018 are the go to. I found https://www.banggood.com/CJMCU-2317-MCP23017-I2C-Serial-Interface-16-bit-IO-Expander-Serial-Module-p-1221484.html?rmmds=search&cur_warehouse=CN  (https://www.banggood.com/CJMCU-2317-MCP23017-I2C-Serial-Interface-16-bit-IO-Expander-Serial-Module-p-1221484.html?rmmds=search&cur_warehouse=CN) will it work directly with the Teensy without extra resistors or other components ?

Thanks
Title: Re: Teensy with an MCP23017
Post by: TalkingTree on Sun, 04 March 2018, 03:14:39
The ErgoDox uses a MCP23018 with a 0.1uF ceramic capacitor but it's listed as optional. (source (https://www.ergodox.io/#electronics))
Title: Re: Teensy with an MCP23017
Post by: Findecanor on Sun, 04 March 2018, 04:32:06
The ErgoDox has also on the controller side a 2.2 kΩ resistor between each corresponding data line and +5V.
Do read the data sheets for the MCP23017/18 and ATmega32U4.
Title: Re: Teensy with an MCP23017
Post by: tototoru on Sun, 04 March 2018, 06:10:52
MCP23018 is hard to get for a reasonable price where I live, so that module with MCP23017 seems great and it has some resistors and a capacitor on board, my question if that will work directly wired to a Teensy ?
Title: Re: Teensy with an MCP23017
Post by: Findecanor on Sun, 04 March 2018, 07:39:08
I would think so. You could google for projects that use it.
I can't see any schematic of the whole circuit - just a block diagram of the IC, I think it is cheap enough that you could get it, look at the traces, measure the resistors and compare against what it says in the data sheets.

The ErgoDone keyboard uses a ATMega32u4 (Arduino Pro Micro instead of Teensy) for one hand and a MCP23017 for the other - and it also uses has two resistors. (Looks like red-red-black (220 Ohm) but I am not sure)

If that would not work for you, I do have a spare MCP23018 but I can't match that price even for just postage to Morocco.
Title: Re: Teensy with an MCP23017
Post by: yangdigi on Sun, 04 March 2018, 07:43:13
I would think so. You could google for projects that use it.
I can't see any schematic of the whole circuit - just a block diagram of the IC, I think it is cheap enough that you could get it, look at the traces, measure the resistors and compare against what it says in the data sheets.

The ErgoDone keyboard uses a ATMega32u4 (Arduino Pro Micro instead of Teensy) for one hand and a MCP23017 for the other - and it also uses has two resistors. (Looks like red-red-black (220 Ohm) but I am not sure)

If that would not work for you, I do have a spare MCP23018 but I can't match that price even for just postage to Morocco.
Ergodone PCB: https://github.com/ktec-hq/ErgoDone
Ergodone firmware: https://github.com/kairyu/tmk_keyboard_custom/tree/master/keyboard/ergodone
Title: Re: Teensy with an MCP23017
Post by: tototoru on Sun, 04 March 2018, 07:58:46
Thanks for your feedback, @Findecanor thanks for the offer but as you said with that price it's more cost effective, 17 and 18 are very similar just some ADDR setting thing that I don't understand nor need. I checked some QMK keyboard that use the MCP2301x like the ergodone and Frenchdev I just wanted to get feedback on this chip since it's easier to solder.

(http://img.banggood.com/thumb/water/oaupload/banggood/images/72/11/9c37a390-e767-4b49-8b4b-6d40c4561f52.JPG)

I think it has the resistors and the capacitor so it's very likely plug and play, I'll get it and see how it goes.
Title: Re: Teensy with an MCP23017
Post by: iocanel on Sat, 14 July 2018, 09:27:57
Did you manage to get the job done with MCP32017? I am in similar situatuion with you and I am really curious.