Skip to content

OnyxNox/MyHitbox

Repository files navigation

My Hitbox

     

Features

  • Simultaneous Opposing Cardinal Directions (SOCD) filtering that prioritizes up over down on the vertical axis and is neutral when both left and right are being pressed.

Hardware Used

  • [1x] Arduino Pro Micro
    • Secured to the back of the 3D print using double-sided tape.
  • [18x] 3 x 8 mm round magnets
  • [15x] Kailh Choc Low Profile Switches (v1)

3D Prints

Printed on a Prusa MK4 which has a print volume of 250 x 210 x 220 mm. Total print time for all pieces was about 12 hours.

Flashing Firmware

The steps below are for flashing firmware to an Arduino Pro Micro (Arduino Micro).

  1. Download latest QMK Toolbox.
  2. Open QMK Toolbox.
  3. Ensure that the correct MCU (AVR only) is selected. Example: ATmega32U4
  4. Click on the Open button and select the MyHitbox.v1.hex file.
  5. Check the Auto-Flash checkbox.
  6. Reset the board twice in rapid succession to enter the bootloader.
    • I found it may take a few tries to successfully flash the firmware due to the Caterina bootloader.

Development

  • Firmware was developed and built using Arduino IDE.
  • Build HEX file in Arduino IDE by navigating to Sketch > Export Compiled Binary.
    • Alt + Ctrl + S
    • HEX file needed is located at build/arduino.avr.micro/MyHitbox.ino.hex.

Side Quests

Flashing Corrupted Bootloader

While I was learning about the Arduino Pro Micro's firmware upload process I mistakenly corrupted the Caterina bootloader, bricking the controller. This led me to learn about Arduino as In-circuit Serial Programmers (ISP) which allows for programming of the whole flash memory of the microcontroller, bootloader included, through a specific set of pins connected to a separate programmer board. I had an ESPWROOM32 laying around to use as a programmer board.

Steps Taken

  1. In the Arduino IDE load the ArduinoISP example. It can be found under File > Examples > 11. Arduino ISP > ArduinoISP.
  2. Update the RESET, LED_HB, LED_ERR and LED_PMODE pins to be 22, 32, 33 and 25 respectively.
    • RESET is originally set to GPIO8 but on the ESP32 pin 8 is for internal SDI. When this pin is used the board enters a bootloop with a TG1WDT_SYS_RESET error.
    • LED_HB, LED_ERR and LED_PMODE are also set to internal pins and need to be reassigned to available output pins to avoid the bootloop.
  3. Upload the modified ArduinoISP sketch to the ESP32.
  4. Hook up the ISP wires between the programmer and target board according to the Pin Map.
  5. Update the target board to be Arduino Micro. It can be set under Tools > Board > Arduino AVR Boards > Arduino Micro.
  6. Set the programmer to be Arduino as ISP. It can be found under Tools > Programmer > Arduino as ISP.
  7. Burn the bootloader to the target board using the programmer. It can be done from Tools > Burn Bootloader.

Pin Map

Description ESP32 Pin Arduino Micro Pin
VCC VIN VCC
GND GND GND
MISO 19 14
MOSI 23 16
SCK 18 15
RESET 22 RST

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages