geekhack

geekhack Community => Keyboards => Topic started by: impaktor on Fri, 06 September 2019, 06:55:00

Title: Setting row/column pins in QMK for a pro micro in handwired keyboard?
Post by: impaktor on Fri, 06 September 2019, 06:55:00
I'm building a dactyl manuform (https://github.com/tshort/dactyl-keyboard), using one arduino pro micoro in each half, but I haven't wired up the columns/rows for the thumb cluster the way others have, since I've been told it doesn't matter, just make sure it's correctly reflected in the software.

Now, this is the Arduino (clone?) pro-micro I have:
(http://www.uugear.com/wordpress/wp-content/uploads/2014/01/ArduinoProMicro_1.jpg)

I've wired in columns to pins: 4,5,6,7,8,9; and rows to: 14,15,A0,A1,A2,A3.

In the QMK firmware (https://github.com/qmk/qmk_firmware/blob/master/keyboards/handwired/dactyl_promicro/config.h#L30), I see:
Code: [Select]
#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 }
#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 }
But this doesn't correspond to my board at all. I have no "B", "D", or "C". What am I getting wrong here?

If anyone has any clarifying comments on where and what I should put in the firmware to get rows and columns correctly mapped from the hardware board to QMK firmware, please let me know, as I've completely stalled on my keyboard project.
Title: Re: Setting row/column pins in QMK for a pro micro in handwired keyboard?
Post by: Findecanor on Fri, 06 September 2019, 09:38:26
The Pro Micro was made for the Arduino environment, and Arduino has its own numbering which does not correspond to the original names of the ATmega32U4's ports.
(I think that Arduino even uses different numbering on different boards that have the same microcontroller ...)

Here (https://deskthority.net/wiki/Arduino_Pro_Micro#Pinout) is a chart that shows how the ATmega32U4 ports are mapped to pins on the Pro Micro.
It is the "Pxy" designation you are after (P="Port", x=port letter, y=bit on port). Apparently those macros in QMK omit the 'P'. For instance PF6 in this chart is 'F6' in QMK. (Port F, bit 6)
Title: Re: Setting row/column pins in QMK for a pro micro in handwired keyboard?
Post by: impaktor on Sat, 07 September 2019, 09:54:59
Yes, that's exactly what I needed! Just flashed my first micro controller, and all keys work!

...except all columns (the right half) are mirrored. I need to figure that out before I finish up the left part.

Also, two keys seem to lag when hitting them in quick sequence, strange.