Skip to content

crkbd_328p

joric edited this page Dec 2, 2023 · 64 revisions

Trying to use Pro Mini for the second half of the Corne keyboard (the first half is Atmega32u4, a standard Pro Micro).

Standard Pro Micro has 18 GPIO (plus 2 pins for RX/TX LEDs, PB0 and PD5).

TL;DR: Pro Mini is NOT compatible with Pro Micro, you have to desolder the second RST pin and built-in LED (PIN13).

See crkbd_328p for the simpler example that does not hang.

Use FTDI at 57600 baud to flash firmware and read debug messages from crkbd_328p matrix.

To build and flash for atmega328p use:

rules.mk:
MCU = atmega328p
OPT_DEFS += -DBOOTLOADER_SIZE=2048
...
PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex
(or)
PROGRAM_CMD = avrdude -V -PCOM6 -c arduino -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex

Status

  • Keyboard matrix works, custom layout works, sends debug messages to UART via FTDI adapter
  • Communication between halves, sadly, doesn't work

Hardware issues

  • Desolder Pro Mini's second RST pin (it's GND on the Pro Micro) to avoid reset loop
  • Desolder Pro Mini's built-in LED at pin 13 (B5) or its load resistor (B5 is used as matrix input)

Software issues

  • VUSB on Pro Mini hangs without data, you need to fix the main loop (see vusb/main.c)
  • No master/slave serial connection. Need to rewrite serial.c from INT2 to PCINT13.
  • No RGB (interferes with UART on TX0)
  • No OLED (i2c setup doesn't work)

Documentation

Pinout

Pinout is vastly different as well, atmega328p has different wiring (see pins marked Pxx):

#if defined(__AVR_ATmega328P__) // Pro Mini
#define MATRIX_ROW_PINS { D4, D5, D6, D7 }
#define MATRIX_COL_PINS { C3, C2, C1, C0, B5, B4 }
#else // default Crkbd Pro Micro layout
#define MATRIX_ROW_PINS { D4, C6, D7, E6 }
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
#endif

Crkbd Schematic

Clone this wiki locally