geekhack

geekhack Projects => Making Stuff Together! => Topic started by: yangdigi on Fri, 11 March 2016, 20:50:52

Title: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: yangdigi on Fri, 11 March 2016, 20:50:52
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.
[attachimg=1]
[attachimg=2]

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

Look at Pro Micro. Only +5v and reset need to be hand wired.
[attachimg=13]

Firstly, I've tested the connections and it works well as a USB to USB keyboard converter.
[attachimg=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.
[attachimg=5]

RAW on Pro Micro 3.3v provides +5v.
[attachimg=6]
 
More pics.
[attachimg=7]
[attachimg=8]
[attachimg=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.
[attachimg=10]
[attachimg=11]
[attachimg=12]
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: suicidal_orange on Sat, 12 March 2016, 06:50:05
That is small!  Great guide too, thanks for writing it up :)
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: njbair on Sat, 12 March 2016, 10:23:38
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?
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: prod on Sat, 12 March 2016, 18:40:08
nice work
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: yangdigi on Sat, 12 March 2016, 20:05:26
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.
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: clickclack123 on Thu, 17 March 2016, 19:22:38
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.
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: PatrickR on Sun, 12 February 2017, 17:22:19
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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: yangdigi on Tue, 14 February 2017, 00:02:22
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.
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: Liocer on Tue, 14 February 2017, 04:34:06
The USB Host adaptors seem pretty impossible to get :S
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: PatrickR on Tue, 14 February 2017, 06:29:02
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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: Liocer 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:
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: PatrickR 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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: spuxx 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?
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: yangdigi on Wed, 01 March 2017, 00:15:24
@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.
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: yangdigi on Wed, 01 March 2017, 00:16:55
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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: Liocer on Tue, 14 March 2017, 18:47:00
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?
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: hackqiang on Thu, 13 April 2017, 07:19:22
great job!
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: supersjimmie on Tue, 06 June 2017, 03:34:30
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?
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: Farmers on Thu, 20 July 2017, 14:07:22
My question about Instant Knockout (http://www.startupmaryland.org/) 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?
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: alive on Sat, 12 August 2017, 16:27:39
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.  :-[
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: odd on Sun, 13 August 2017, 18:49:30
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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: odd on Sat, 26 August 2017, 13:51:55
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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: PatrickR on Sun, 29 April 2018, 17:14:37
@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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: clickclack123 on Tue, 23 April 2019, 00:22:25
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.
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: bamrocket on Sat, 29 August 2020, 01:37:42
Sorry to revive an old thread, but has anybody taken a crack at this with the Teensy 4.1's USB host?
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: jpayne 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
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: TGA on Sat, 27 March 2021, 00:26:44
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".
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: herfalerf on Sun, 16 January 2022, 20:15:49
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

Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: wgjhstt247 on Tue, 24 January 2023, 21:55:55
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.
Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: Nonuke 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!



Title: Re: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield)
Post by: wgjhstt247 on Sat, 04 March 2023, 19:49:30

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.