Author Topic: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)  (Read 58906 times)

0 Members and 1 Guest are viewing this topic.

Offline yangdigi

  • Thread Starter
  • Posts: 79
  • Location: China
Haus's USB to USB keyboard converter topic:
https://geekhack.org/index.php?topic=69169.0
Big thanks to him.

I found there is no guide that uses a Pro Micro 3.3V(not Mini) with mini host shield to make a USB to USB keyboard converter. I've searched the web and found only Teensy with mini host shield to do this.
https://www.pjrc.com/teensy/td_libs_USBHostShield.html

Pro Micro is much cheaper than Teensy. I got Pro Micro 3.3V and mini host shield from a friend of mine who combined all pins of the two together in a wrong way.  I separated them and combined them again. Here I want to share what I did.

There are a few examples for Teensy with mini host shield.

130848-1

Pro Micro does't have a PC7. But in fact it use pin9 and pin10. I draw a simple pic to show pin connections.


Look at Pro Micro. Only +5v and reset need to be hand wired.
130881-3

Firstly, I've tested the connections and it works well as a USB to USB keyboard converter.
130854-4

Then, It's time to make them combined. Mini host shield need a little mod to separate the USB host power from the 3.3v power. There is no jumper on this mini host shield so I cut the line on pcb. Two extra wires are needed here, one to VBUS and the other connects reset with 3.3v.
130856-5

RAW on Pro Micro 3.3v provides +5v.
130858-6
 
More pics.
130860-7
130862-8
130864-9

It's small. And I think making this one is much easier than using Teensy with mini host shield.

After simply cleaning the PCBs, it looks a litter better now.
130873-10
130875-11
130878-12
« Last Edit: Sat, 12 March 2016, 09:16:54 by yangdigi »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
That is small!  Great guide too, thanks for writing it up :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline njbair

  • Posts: 2825
  • Location: Cleveland, Ohio
  • I love the Powerglove. It's so bad.
    • nickbair.net
Nice work. I bought one from hasu, then built a second one from a full-size Leonardo clone and USB host shield, both made by SainSmart.

Maybe I missed it in the OP, but what was the total BOM for this project?

Alpine Winter GB | My Personal TMK Firmware Repo
IBM Rubber Band "Floss" Mod | Click Modding Alps 101 | Flame-Polishing Cherry MX Stems
Review: hasu's USB to USB converter
My boards:
More
AEKII 60% | Alps64 HHKB | Ducky Shine 3, MX Blues | IBM Model M #1391401, Nov. 1990 | IBM SSK #1391472, Nov. 1987, screw modded, rubber-band modded | Noppoo EC108-Pro, 45g | Infinity 60% v2 Hacker, Matias Quiet Pros | Infinity 60% v2 Standard, MX Browns | Cherry G80-1800LPCEU-2, MX Blacks | Cherry G80-1813 (Dolch), MX Blues | Unicomp M-122, ANSI-modded | Unicomp M-122 (Unsaver mod in progress) | 2x Unitek K-258, White Alps | Apple boards (IIGS, AEKII) | Varmilo VA87MR, Gateron Blacks | Filco Zero TKL, Fukka White Alps | Planck, Gateron Browns | Monarch, click-modded Cream Alps

Offline prod

  • Posts: 67
  • Location: China
nice work
Chicory|YDPv2(BLUP)|BLE40|Daisy|YDPM|YD40w|Golbat

Offline yangdigi

  • Thread Starter
  • Posts: 79
  • Location: China
Nice work. I bought one from hasu, then built a second one from a full-size Leonardo clone and USB host shield, both made by SainSmart.

Maybe I missed it in the OP, but what was the total BOM for this project?
In this topic, I just showed how to make USB to USB keyboard converter with a Pro Micro 3.3v and mini host shield.
The other two converters are only for size comparing.

Offline clickclack123

  • Posts: 357
  • Location: Australia, Mate!
Great work and thanks so much for all the info, this is a great option.

I bought a host shield mini a long time ago and planned to have a go at this but never got around to working it out.

With the USB Host Shield Mini boards being AUD$8.43 (US$6.29) from China on ebay now, this is a nice option. I couldn't find the 3.3V Pro Micro boards on ebay but the 5V ones are AUD$5.31 (US$3.96). It's not too hard to change the regulator to a 3.3V one, I've done it with a hot air station, kapton tape and applying solder paste with a toothpick, and the regulators are cheap, eg SPX3819 http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=181963109679 AUD$3.86 (US$2.78) for 10. That would be running the Pro Micro slightly out of spec, 16MHz at 3.3V but reports suggest that it works fine.

Offline PatrickR

  • Posts: 6
In this topic, I just showed how to make USB to USB keyboard converter with a Pro Micro 3.3v and mini host shield..
You wrote Pro Micro 3.3v, I thought a Pro Micro 3V3 variant has a 8MHz quartz but on your pictures it seems it's the 16MHz quartz on the board like on the 5V Pro Micro ?
So I'm a little bit confused.

Patrick

Offline yangdigi

  • Thread Starter
  • Posts: 79
  • Location: China
In this topic, I just showed how to make USB to USB keyboard converter with a Pro Micro 3.3v and mini host shield..
You wrote Pro Micro 3.3v, I thought a Pro Micro 3V3 variant has a 8MHz quartz but on your pictures it seems it's the 16MHz quartz on the board like on the 5V Pro Micro ?
So I'm a little bit confused.

Patrick
That Pro Micro is a Chinese clone one from taobao. It's 3.3v but 16Mhz quartz.
Pro Micro 3.3v with 8Mhz quartz can work well too.

Offline Liocer

  • Posts: 122
  • Location: London, UK
The USB Host adaptors seem pretty impossible to get :S

Offline PatrickR

  • Posts: 6
The USB Host adaptors seem pretty impossible to get :S
Which do you mean ?

That Pro Micro is a Chinese clone one from taobao. It's 3.3v but 16Mhz quartz.
Pro Micro 3.3v with 8Mhz quartz can work well too.
As hint, but I'm sure you know it already, related to the "ATMega32U4", the 3.3V with 16MHz, is out of the Safe Operating Area.
But I also read that it works as you described and done it.  :thumb:

Patrick

Offline Liocer

  • Posts: 122
  • Location: London, UK
Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
« Reply #10 on: Tue, 14 February 2017, 06:37:10 »
The USB Host adaptors seem pretty impossible to get :S
Which do you mean ?

That Pro Micro is a Chinese clone one from taobao. It's 3.3v but 16Mhz quartz.
Pro Micro 3.3v with 8Mhz quartz can work well too.
As hint, but I'm sure you know it already, related to the "ATMega32U4", the 3.3V with 16MHz, is out of the Safe Operating Area.
But I also read that it works as you described and done it.  :thumb:

Patrick

Apparently my ebay fu was not strong.. but it got better  :thumb:

Offline PatrickR

  • Posts: 6
Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
« Reply #11 on: Fri, 24 February 2017, 02:34:38 »
@yangding

Which bootloader did you use ?
The one which is provided with the board, which is this ?
Or did you upload the Caterina https://github.com/sparkfun/Arduino_Boards/tree/master/sparkfun/avr/bootloaders/caterina ?

Do you have some information about the software libs which you used ?

Many thanks.
Patrick

Offline spuxx

  • Posts: 15
Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
« Reply #12 on: Tue, 28 February 2017, 08:29:05 »
I tried this but can't get the Pro Micro 3.3V 8MHz to work with the tmk usb_usb converter firmware. When I plug in the Pro Micro with the firmware flashed, there is always a USB enumeration problem and the converter does not show up as a USB device. @yangding, did you change anything in the usb_usb converter code or did it work for you without a problem?

Offline yangdigi

  • Thread Starter
  • Posts: 79
  • Location: China
@yangding

Which bootloader did you use ?
The one which is provided with the board, which is this ?
Or did you upload the Caterina https://github.com/sparkfun/Arduino_Boards/tree/master/sparkfun/avr/bootloaders/caterina ?

Do you have some information about the software libs which you used ?

Many thanks.
Patrick
I use its default bootloader.

Offline yangdigi

  • Thread Starter
  • Posts: 79
  • Location: China
I tried this but can't get the Pro Micro 3.3V 8MHz to work with the tmk usb_usb converter firmware. When I plug in the Pro Micro with the firmware flashed, there is always a USB enumeration problem and the converter does not show up as a USB device. @yangding, did you change anything in the usb_usb converter code or did it work for you without a problem?
If your Pro Micro is 8MHz, change F_CPU = 16000000 to F_CPU = 8000000 in Makefile

Offline Liocer

  • Posts: 122
  • Location: London, UK
Not sure if I've done something wrong, built the board exactly as you have, my pc sees the pro micro with tmk flashed on it. But no keyboard when connected.

Will have to get the multimeter out to check the connections (pretty sure they're good).

Hmm, any ideas?

Offline hackqiang

  • Posts: 2
great job!

Offline supersjimmie

  • Posts: 1
My question is probably very easy, but there's only one thing that I don't understand.
The Reset pin... 
There is a RST on the Arduino and a RESET on the USB Host shield but they are different reset pins and are not inter-connected.
Also, on my "normal sized" USB Host shield, on an Arduino UNO, the host shield reset is connected to the ICSP pin called RESET.
Since there is no ICSP on the Pro Micro, I think that's why this topic explains that there needs to be done something with the reset pin.

But do I correctly understand that here the USB Host Shield RESET is connected to the +3.3V, so it will always be HIGH?

Offline Farmers

  • Posts: 1
My question about Instant Knockout is probably very easy, but there's only one thing that I don't understand.
The Reset pin... 
There is a RST on the Arduino and a RESET on the USB Host shield but they are different reset pins and are not inter-connected.
Also, on my "normal sized" USB Host shield, on an Arduino UNO, the host shield reset is connected to the ICSP pin called RESET.
Since there is no ICSP on the Pro Micro, I think that's why this topic explains that there needs to be done something with the reset pin.

But do I correctly understand that here the USB Host Shield RESET is connected to the +3.3V, so it will always be HIGH?

Hey Jimmie I was just wondering about that too. Did you manage to find the answer?
« Last Edit: Tue, 09 June 2020, 17:33:32 by Farmers »

Offline alive

  • Posts: 1
Hi! I'm newbie here. Yesterday I made exactly the same scheme with arduino pro micro and usb host shield. I wanted to make something like this for a half of year and yesterday I found this topic. But at the moment I can't make working code for it. You said, that you are using stock bootloader, so you aren't using firmware from tmk topic ( https://geekhack.org/index.php?topic=69169.0 )? I tried to upload USBHIDBootKbd and USBHIDMultimediaKbd from USB_Host_Shield_2.0 examples. But it seems, that it made for teensy. I replaced #include <spi4teensy3.h> by #include <SPI.h>, but it doesn't helps. Port mon shows only "Start" and nothing else, when I'm pressing keys on plugged keyboard. Please, can you share your code if it's written with arduino IDE or firmware?

P.S.: Sorry for my terrible english.  :-[

Offline odd

  • Posts: 321
Can some one help me here. I am having a hell of a time trying to figure out where to wire up the reset wire on the USB shield. I have been looking at the pics here and the ones on from the links and I just don't get it. It looks like I am supposed to wire it to the 3.3v on the USB shield but I though that (3.3v on USB) goes to VCC on the promicro.

I have included this pic, thanks everyone

http://imgur.com/a/m692R

Offline odd

  • Posts: 321
Not sure if I've done something wrong, built the board exactly as you have, my pc sees the pro micro with tmk flashed on it. But no keyboard when connected.

Will have to get the multimeter out to check the connections (pretty sure they're good).

Hmm, any ideas?

I have the same issue

Offline PatrickR

  • Posts: 6
@yangding

Could you tell us which software did you used ?
Maybe you can provide your software to us including your adaptions ?
Maybe you have an Arduino tradable file.

Many thanks for you great nice work and that you told us about it.

THX

Patrick
« Last Edit: Mon, 30 April 2018, 02:23:24 by PatrickR »

Offline clickclack123

  • Posts: 357
  • Location: Australia, Mate!
Thanks yangdigi for the great instructions!!

I just wired up my Pro Micro 3.3V 8MHz to the USB Host Shield Mini (official circuitsathome version).

Haven't tried it as a keyboard converter as I don't really need it anymore (Ergodox FTW!!) but I did run some of the Arduino example sketches. It could scan USB devices that are connected to it and I even got it reading an Xbox controller, so I do know it's wired up correctly.

Very neat.

Can some one help me here. I am having a hell of a time trying to figure out where to wire up the reset wire on the USB shield. I have been looking at the pics here and the ones on from the links and I just don't get it. It looks like I am supposed to wire it to the 3.3v on the USB shield but I though that (3.3v on USB) goes to VCC on the promicro.

I have included this pic, thanks everyone

http://imgur.com/a/m692R

I'm sure you've worked it out by now, but...

The RST on the host board needs to go to 3.3V, which is the same as VCC on the ProMicro. You do have a 3.3V ProMicro, right?

The other wire is for 5V (RAW on the Promicro) to VBus on the Host Shield. Remember to cut the link on the Host Shield for VBus, otherwise you'd be shorting 5V to 3.3V.
« Last Edit: Tue, 23 April 2019, 00:30:04 by clickclack123 »

Offline bamrocket

  • Posts: 6
Sorry to revive an old thread, but has anybody taken a crack at this with the Teensy 4.1's USB host?

Offline jpayne

  • Posts: 1
Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
« Reply #25 on: Wed, 10 February 2021, 10:10:20 »
Great project! I had no issue building this. one thing i did do that may help others is to add a through hole tactile switch to the reset and ground, i cant see how to post a picture but to describe it, on the side of the boards sat on the header pins and securely soldered to both boards- the spacing is perfect ! i had to get a bit creative with the heat shrink tubing to finish the project off - bit of a slit in two pieces and slid them over from opposite sides so as to leave the switch exposed.
Promicro 3.3v + shield

Offline TGA

  • Posts: 1
Very useful topic! I made one. But because have only "Pro Micro 5V / 16MHz" I had do that more complicated way.  With converters and "F_CPU = 16000000".

Offline herfalerf

  • Posts: 91
Not sure if I've done something wrong, built the board exactly as you have, my pc sees the pro micro with tmk flashed on it. But no keyboard when connected.

Will have to get the multimeter out to check the connections (pretty sure they're good).

I have the same issue too, did you ever find a resolution?

Hmm, any ideas?

I have the same issue


Offline wgjhstt247

  • Posts: 2
Thank you for putting this together! I was able to build this with a Pro Micro 3.3V/8Mhz board, default Lilypad bootloader, and it works great. It cost about $10 USD for a pro micro 3.3V/8Mhz and USB Host Shield 2.0 mini.
Tips for others who are still trying to build this:
1) Edit the Makefile and update F_CPU as others have mentioned.
2) Compile the firmware yourself, as the prebuilt firmware in the repository is for 16Mhz boards. If you compile it on Windows, ignore the DLL load error when the symbol file is generated. Use "make -f Makefile.unimap" to create a firmware file that you can load into the online keymap editor and edit.
3) If using Windows to install the firmware, use avrdude. Look up the COM port in Device Manager when you reset the board to DFU mode.
4) If you get no keyboard connectivity/usb activity when viewing the output of hid_listen, make sure Vcc and GND are connected properly to the usb host shield 2.0 mini. Vcc should be connected to both MAX_RST on the usb host shield 2.0 mini AND Vcc on the Pro Micro. MAX_RST must be held high. If that's good, install the board_qc Arduino sketch and run the test to verify that SPI communication is working.
5) The SPI pin labeling on the usb host 2.0 mini board is wrong. Don't let this fool you. The pin connections laid out in the OP are correct.

Offline Nonuke

  • Posts: 10
Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
« Reply #29 on: Sat, 11 February 2023, 12:07:03 »
Well, unfortunately, I had no luck. After assembly and firmware flashing the pro micro is recognized by the PC on linux and on windows without an issue, as an hid device.

My pro micro is 16Mhz so I had to change the CPU frequency. It showed up properly with tmk and with qmk.

When I connect a keyboard to it, there is electricity - leds shine up - but no key presses are recognized. I am really not sure where It went wrong.

That's the boards I got:
https://www.amazon.it/dp/B0B8H6XJJT
https://www.amazon.it/dp/B07Y83TJ47

I have no clue how to troubleshoot it. I could erase the firmware and put the stock one - but I do not know how to start debugging to see if the USB shield is actually transmitting data to the pro micro. 

If someone can point me in the right direction it will be much appreciated!



E la nave va...

Offline wgjhstt247

  • Posts: 2

That's the boards I got:
https://www.amazon.it/dp/B0B8H6XJJT
https://www.amazon.it/dp/B07Y83TJ47

I have no clue how to troubleshoot it. I could erase the firmware and put the stock one - but I do not know how to start debugging to see if the USB shield is actually transmitting data to the pro micro. 

If someone can point me in the right direction it will be much appreciated!

You’ll need a logic level converter for the SPI connections and a dc-dc step down converter to step down 5V to 3.3V. Your pro micro runs at 5V; USB host shield runs at 3.3V. If you have this already, perfect. If not, you may have fried your usb host shield? You can test the SPI connectivity between the pro micro and usb host shield by loading board_qc firmware from the examples folder in the USB Host Shield library on GitHub. After loading the firmware, you’ll connect to the serial port to get the test results. SPI test should pass if all is working. If the SPI test fails, make sure the usb host shield has power (Vcc and GND) and check SPI connections. If SPI is working, it could be that you are not using the unimap makefile, which contains the default keymap. If the keymap is not loaded or not configured, pressing keys will do nothing.