How to use a Pro Micro as a cheap controller/converter
-
- Location: Houston, Texas
- Main keyboard: IBM Bigfoot
- Main mouse: CST trackball
- Favorite switch: IBM Model F
- DT Pro Member: -
Yes, very nice writeup. I have some bash and Python scripts that I use to program the Pro Micros. Here's the bash script, which I name something like burn.sh:
Here's the Python script which it invokes (reset.py):
All you have to do is edit the bash script to reflect the hex file you wish to burn. It works every time without fail, and I so far haven't had occasion to go back and update the firmware.
Code: Select all
#!/bin/bash
python reset.py /dev/ttyACM0
sleep 2
avrdude -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:./Soarer_at2usb_v1.12_atmega32u4.hex:i
Code: Select all
import serial, sys
serialPort = sys.argv[1]
print serialPort
ser = serial.Serial(
port=serialPort,
baudrate=1200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
ser.isOpen()
ser.close() # close port
- macmakkara
- Location: Finland
- DT Pro Member: -
Oh btw there is package called winAVR http://sourceforge.net/projects/winavr/ for windows and it incudes avrdude.
But when using pro micro you also need to install arduino IDE for leonardo drivers.
Then to othen point. Im gettin error when trying to flash avrdude: error: buffered memory access not supported. Matbe it isn't a butterfly/AVR109 but a AVR910 device?
But when using pro micro you also need to install arduino IDE for leonardo drivers.
Then to othen point. Im gettin error when trying to flash avrdude: error: buffered memory access not supported. Matbe it isn't a butterfly/AVR109 but a AVR910 device?
- Laser
- emacs -nw
- Location: Romania
- Main keyboard: Plum TKL \w Topre domes (work) / Novatouch (home)
- DT Pro Member: 0180
- macmakkara
- Location: Finland
- DT Pro Member: -
Oh didin't see that. Need to get new cable somewhere.
- Nuum
- Location: Germany
- Main keyboard: KBD8X Mk I (60g Clears), Phantom (Nixdorf Blacks)
- Main mouse: Corsair M65 PRO RGB
- Favorite switch: 60g MX Clears/Brown Alps/Buckling spring
- DT Pro Member: 0084
Maybe that's the problem I had with my FaceU which runs ps2avr and is not working properly with a cheap USB cable. Now it is working with a slightly more expensive cable. I don't know whether ps2avr and winAVR are related but it sounds like they are.
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
That's insane... I need to get some more mini USB cables! Maybe my face-u isn't dead after all! That'd be a bit of a pain after I went and bought a whole new PCB from matt3o.
![Laughing :lol:](./images/smilies/icon_lol.gif)
- macmakkara
- Location: Finland
- DT Pro Member: -
Yep and also there is some known problems with USB 3.0 and atmega32 without any solutions. If your using usb 3.0 test at usb 2.0 or with 2.0 usb hub. Didin't work for me.
- chzel
- Location: Athens, Greece
- Main keyboard: Phantom
- Main mouse: Mionix Avior 7000
- Favorite switch: Beamspring, BS, Vintage Blacks.
- DT Pro Member: 0086
I made a soarer's converter with a Pro micro last night and using a thin noodly micro usb cable caused the uC to brown out (voltage momentarily dropping low enough to reset the uC) when I connected the keyboard, and for some reason my Tipro still refuses to work with it, while the M works just fine!
- macmakkara
- Location: Finland
- DT Pro Member: -
Got new cable today. Still no go... I think i need to install linux...
- macmakkara
- Location: Finland
- DT Pro Member: -
I have used linux daily when i did not game much. Actually i still have my arch install with xfce on my laptop but its really old and last update forked it. So it doesn't boot to xfce (can access console though). And i run Dedicated debian server. But im propably going to download debian and install it on my laptop.
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Fair enough. I used to be much more into it before I tried it. Just haven't got the patience to manage a computer as closely as that. I'm not the right kind of mind for the terminal, apparently. Let alone programming… which always works so much better before I hit build! Anyway, enough grumbling. It's that trafficky time of day.
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
@Scott: What dd you do for earthing? I've got an AT I want to install one of these in as well. (My one and only Pro Micro has been sitting around waiting for a purpose while Teensies get all the fun.) But Model Fs are capsense and so pretty damn sensitive when it comes to earthing.
I'd like to know where to tap the earth connection to the Pro Micro. Or does it not matter so much once the case is done up?
I'd like to know where to tap the earth connection to the Pro Micro. Or does it not matter so much once the case is done up?
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
I actually didn't do anything apart from wiring those four pins that I showed in the OP. I never actually mounted it in the case after all, I ended up taking it apart and using it for some other projects since I didn't need any Soarer converters at the time (which is no longer the case since I modded my AT's layout a week or two ago). It worked just fine for the time that I tested it like that on my AT, so I'd say you'd be alright!
- beltet
- Location: Stockholm Sweden
- Main keyboard: Custom NerD60
- Main mouse: Saitek cyborg R.A.T 7
- Favorite switch: Ergo MX Clear
- DT Pro Member: -
What I did on my M 122 was that I soldered it on top of the USB mini port on the teensy. I thought that it wouldn't be wise to combine GND and earth.
EDIT: I think it was like that... Not 100% sure... And I can't check either because the board ain't at home. I remembered it was quite a pain to get it onto it. But maybe I didn't have the right tools at the moment.
EDIT: I think it was like that... Not 100% sure... And I can't check either because the board ain't at home. I remembered it was quite a pain to get it onto it. But maybe I didn't have the right tools at the moment.
-
- Main keyboard: Apple Desktop Bus Keyboard (1987)
- Main mouse: Bloody TL-8
- Favorite switch: MX-clear and ALPS Orange
- DT Pro Member: -
Can't seem to get this to work. Im using a Pro Micro and have Data hooked up to PD1 and clock to PD0 and nothing happens when i hook up the converter exept it shows up in my hardwarelist as a keyboard.
I've added a 4K pull-up resistor to the data line from VCC and that made the keyboard light up when i hooked it up but its still not working. Do I need a pul-up resistor on the clock line aswell?
Ive changed the PS2_DATA_BIT to 1 and PS_CLOCK_BIT to 0 in the config on USART as the Pro Micro does not have PD5 (it does but thats one of the internal leds).
I've added a 4K pull-up resistor to the data line from VCC and that made the keyboard light up when i hooked it up but its still not working. Do I need a pul-up resistor on the clock line aswell?
Ive changed the PS2_DATA_BIT to 1 and PS_CLOCK_BIT to 0 in the config on USART as the Pro Micro does not have PD5 (it does but thats one of the internal leds).
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
What keyboard are you using with it? And are you sure you've got the polarity for VCC and GND right?
I had an embarassing mishap with those and this here AT recently. (I misread the AT port diagram, and had things horizontally flipped.) My Pro Micro survived, but all that would happen with the keyboard connected was some light in the lock LEDs.
I had an embarassing mishap with those and this here AT recently. (I misread the AT port diagram, and had things horizontally flipped.) My Pro Micro survived, but all that would happen with the keyboard connected was some light in the lock LEDs.
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
Was it a momentary light on the lock LEDs, or did they remain turned on?Muirium wrote: What keyboard are you using with it? And are you sure you've got the polarity for VCC and GND right?
I had an embarassing mishap with those and this here AT recently. (I misread the AT port diagram, and had things horizontally flipped.) My Pro Micro survived, but all that would happen with the keyboard connected was some light in the lock LEDs.
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
I've never used TMK on a Pro Micro so I can't be sure. Sorry about that.
I'm interested in what Mu encountered because I might've run into the same thing at one point without realising!
I'm interested in what Mu encountered because I might've run into the same thing at one point without realising!
- jou
- Location: Switzerland
- Main keyboard: Ergodox
- Main mouse: Apple Magic Trackpad
- Favorite switch: Not sure yet
- DT Pro Member: -
If you need more than the 18 pins available, you can get two more by repurposing the onboard LED pins.
I just did an Atreus build with a Pro Micro clone and was exactly two pins short. I needed 15 pins for the matrix, 2 for the Trackpoint and 3 for indicator LEDs, totalling 20. So I desoldered the RX/TX LEDs and soldered wires to the end of the current limiting resistor connected to the controller.
There's also a reset button, so every pin except RAW on that little thing is connected to something.
I just did an Atreus build with a Pro Micro clone and was exactly two pins short. I needed 15 pins for the matrix, 2 for the Trackpoint and 3 for indicator LEDs, totalling 20. So I desoldered the RX/TX LEDs and soldered wires to the end of the current limiting resistor connected to the controller.
There's also a reset button, so every pin except RAW on that little thing is connected to something.
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Could have been a flash, or could have been constant dim lighting across all three LEDs. I had both of those with it, but I forget which way round. My next problem was the Pro Micro crapping out when I plugged too much other stuff into my USB hub. The keyboard was so picky! I cured that by swapping it out for a Teensy 2.
The Pro Micro's still loaded with Soarer's Converter though, so I'll just use it in something else. Has to be a smaller board than this one though. The big boys are always up on my standing desk with the hub.
- XMIT
- [ XMIT ]
- Location: Austin, TX area
- Main keyboard: XMIT Hall Effect
- Main mouse: CST L-Trac Trackball
- Favorite switch: XMIT 60g Tactile Hall Effect
- DT Pro Member: 0093
I'm using TMK on a Pro Micro just fine. There are only a couple of things to remember:
- In the Makefiles, remember to always set:
Some have this set by default, but e.g. M0110 does not.
- In the Makefile, assuming you are using avrdude for programming as I am, also do:
- I found a 10k pullup was necessary for older boards. Try with and without it.
- With the default bootloader, short RST to GND twice in succession. Then you have 8 seconds to flash!
- In the Makefiles, remember to always set:
Code: Select all
MCU = atmega32u4
- In the Makefile, assuming you are using avrdude for programming as I am, also do:
Code: Select all
# Program Sparkfun Pro Micro using avrdude
PROGRAM_CMD = avrdude -p $(MCU) -P /dev/cu.usbmodem1421 -c avr109 -U flash:w:$(TARGET).hex
- With the default bootloader, short RST to GND twice in succession. Then you have 8 seconds to flash!
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
That tip for the Makefile is really nice. I hadn't thought of putting it in there at all. Of course, the device path might be different, though.
I haven't tried using a 10k pullup. I'll give it a go if I ever run into problems!
I haven't tried using a 10k pullup. I'll give it a go if I ever run into problems!
-
- DT Pro Member: -
I am having problems with avrdude:
avrdude: butterfly_recv(): programmer is not responding.
This error occurs when I try to run:
avrdude -p atmega32u4 -P YOUR_SERIAL_PORT -c avr109 -U flash:w:filename.hex
where I have replaced YOUR_SERIAL_PORT and filename.hex with proper ones.
Does someone know a solution for this?
avrdude: butterfly_recv(): programmer is not responding.
This error occurs when I try to run:
avrdude -p atmega32u4 -P YOUR_SERIAL_PORT -c avr109 -U flash:w:filename.hex
where I have replaced YOUR_SERIAL_PORT and filename.hex with proper ones.
Does someone know a solution for this?
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
Are you using Linux or Windows? In Linux, check the output of dmesg. You can use `watch "dmesg | tail"` or just run `while true; do clear; dmesg; sleep 5; done`. In Windows, you should see something like "Arduino Leonardo Bootloader" pop up in the device manager.
If you're using OS X, god only knows but it's possibly the same as Linux. I'm in an airport right now so I can't check since I don't have a boards with me.
If you're using OS X, god only knows but it's possibly the same as Linux. I'm in an airport right now so I can't check since I don't have a boards with me.