Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add more gpios? #614

Closed
xiaoquanaa opened this issue Jan 18, 2021 · 8 comments
Closed

How to add more gpios? #614

xiaoquanaa opened this issue Jan 18, 2021 · 8 comments

Comments

@xiaoquanaa
Copy link

Hi, guys, i watched nicell's video of zmk on youtube , it helped me a lot in making my self 's first bluetooth customed key board . but what confused me is that the zmk's gpio number seems fixed in 21(which is pro mico's gpio number) . yes it is enough to assemble a 100key keyboard by a 10x10 matrix with matrix-transform , but this lead to a uncomfortable feeling when routering the pcb . so i think maybe there is some way to add the gpio number to 25 or more , thus i can make a 19x6 matrix . but since i am not a professional programmer , and English is not my first language , so i have trouble in doing that .i have found this two files \zmk\app\boards\arm\nice_nano\arduino_pro_micro_pins.dtsi and \zmk\app\dts\common\arduino_uno_pro_micro_map.dtsi maybe the relative file . i will appreciate if you can spare your time to tell me how to add the gpio number . Thanks !

@crides
Copy link
Contributor

crides commented Jan 18, 2021

This is not dependent on the firmware, it's a limitation of the hardware itself. The Pro micro only has 18 GPIOs, and the nice!nano has 21 in total (23 if you also use the 2 SMD pads). So unless you are using another board that Zephyr supports and has more IOs, or integrate a module (like the holyiot) or a bare chip (that Zephyr supports) into your keyboard PCB it's not possible.

@Synless
Copy link

Synless commented Jul 21, 2021

This is not dependent on the firmware, it's a limitation of the hardware itself. The Pro micro only has 18 GPIOs, and the nice!nano has 21 in total (23 if you also use the 2 SMD pads). So unless you are using another board that Zephyr supports and has more IOs, or integrate a module (like the holyiot) or a bare chip (that Zephyr supports) into your keyboard PCB it's not possible.

Wouldn't it be possible to use a shield with shift registers to achieve more IO ?

@crides
Copy link
Contributor

crides commented Jul 21, 2021

Of course, but using a dedicated IO expander would probably be easier

@Synless
Copy link

Synless commented Jul 21, 2021

Of course, but using a dedicated IO expander would probably be easier

Thanks for the swift answer.
What would be the best way to work with shift register ? Does ZMK supports is natively or a "manually written key scan" would be needed ?

@crides
Copy link
Contributor

crides commented Jul 21, 2021

I'm not sure why one would actually use shift registers for this purpose. There's support for IO expanders in ZMK

@Synless
Copy link

Synless commented Jul 21, 2021

Could you link to an example of that ?
It the documentation of ZMK only what is on https://zmk.dev/docs ?
I struggle to find GPIO read/write and the regular MCU interactions (coming from QMK)

@crides
Copy link
Contributor

crides commented Jul 22, 2021

You should check the Ferris PR

Until ZMK has support for pluggable modules, you'll have to modify the internals. As it's based on Zephyr, all the HAL utilities comes from there.

@caksoylar
Copy link
Contributor

Closing as it is a user question, as an aside #hardware channel at the ZMK Discord is a useful place for such questions and discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants