I tried to recover the Arduino but whatever I did it couldn't be reprogrammed.
I reset the 2 pins to put it into bootloader mode for 8 seconds and the 3 lights stayed on after uploading the 'Hello world' or 'Blink' sketch. But when I tried to upload another sketch the com port would disappear.
Yes, Arduinos use a different port for programming mode than for normal mode.
I've found that using avrdude and two .bat files works well for loading firmwares on a Pro Micro.
(Hat tip to JayBee for the code in the "progmode.bat" file.
)
- The "progmode.bat" file puts the Pro Micro into programming mode by opening and closing the normal COM5 serial port.
@echo off
mode COM5 BAUD=1200 PARITY=n DATA=8
TIMEOUT 3 /NOBREAK
- The "load.bat" file loads the .hex file through the COM6 port into flash memory using this single-line command.
avrdude -p atmega32u4 -P COM6 -c avr109 -U flash:w:MINIARCADE2.hex -C avrdude.conf
To use this approach:
1. Install avrdude on your computer.
2. Install the Arduino Leonardo/Mini bootloader driver as per the instructions at
https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2.
3. Put a copy of the desired firmware .hex file in the avrdude folder.
4. Identify the normal and programming mode COM ports for your Arduino.
- In Windows Control Panel -- Devices and Printers, right-click on the Arduino and select "Properties".
- You'll find the normal COM port under the "Hardware" tab. (the code above assumes COM5)
- Close the Properties window.
- Double click to reset the board.
-- The Arduino icon will disappear and an "Arduino Micro bootloader (COM6)" icon will appear. The name contains the programming mode COM port. (the code above assumes COM6)
5. Create "progmode.txt" and "load.txt" files in the avrdude folder.
6. Open them in Notepad.
- Copy/paste the batch file code above.
- Change "MINIARCADE2.hex" to the firmware filename.
*** NOTE: The .hex filename is case sensitive. Make sure it matches.
***- Change COM port numbers to match what you saw in step 4.
- Save and exit.
7. Rename the "progmode.txt" file to "progmode.bat" and rename the "load.txt" file to "load.bat".
- If you ever need to edit the .bat file, change the extension back to .txt.
8. Left-click on an empty part of the avrdude folder window so nothing is selected. In an empty part of the window Shift+Right-click -- "Open command window here". (this saves you manually navigating to the avrdude folder using "cd" commands)
9. Type "progmode.bat" and hit ENTER.
- Board goes into programming mode.
10. While the board is in programming mode, type "load.bat" and hit ENTER.
- Avrdude loads the firmware on the board.
Is this file OK to use?
https://www.gitmemory.com/issue/bootsector/XBOXPadMicro/1/483612292
Bruno posted the file and a Pro Micro pinout image so it
should work fine on a Pro Micro.
Pretty sure the firmware in
reply #82 would also work -- pinout for that firmware is in reply #83.
[EDIT: That firmware is for X360/Xinput.]
Scott