USB host shield doubt/problem

caberolo

13 Oct 2022, 18:01

Hello everyone

A few months ago I bought a usb host shield, to mount a usb-usb converter (like this one https://yaowei.dev/posts/usb-to-usb-converter/, for example).

It is supposed to be able to directly attach a promicro or similar microcontroller (I have a Chinese clone saved for it).

The right column of the usb host shield is labelled as in the picture:
usb-hs.jpeg
usb-hs.jpeg (175.12 KiB) Viewed 3542 times
The problem is that the order on that row of pins should be (from top to bottom), SS-MOSI-MISO-CLK.

Looking into the issue, it's not clear to me if it's a problem with the labelling, or if the MOSI-CLK pins are actually crossed. Most mini USB host shields sold on Aliexpress are labelled like mine; I'm surprised that all of them are wrong.

Thanks in advance.

User avatar
Muirium
µ

13 Oct 2022, 18:40

caberolo wrote:
13 Oct 2022, 18:01
should
According to what source? Your eyes are saying otherwise.

caberolo

13 Oct 2022, 23:47

Muirium wrote:
13 Oct 2022, 18:40
caberolo wrote:
13 Oct 2022, 18:01
should
According to what source? Your eyes are saying otherwise.
Actually the labels are saying otherwise, but I don't know if the pins are in correct order.

Well, the promicro (and clones) pinout:
Image

The elite-C one:
Image
and even the new RP2040 based microcontrollers
Image

use the same pin order (from bottom to top, SS, MOSI, MISO, CLK)

So I wonder why a board intended to work alongside (literally, pin-to-pin) with this class of devices, has a pair of twisted pins.

Thanks for reading.

User avatar
Bjerrk

14 Oct 2022, 07:35

I had (have, really) the same problem! In fact, I still have a non-functional pro micro/USB host shield wired up somewhere on my desk ...

Anyway, I think the source of the problem is explained here:
https://forum.arduino.cc/t/usb-host-min ... spi/314349

As I understand it, it mimicks the Pro Mini pinout rather than the Pro Micro!

User avatar
Muirium
µ

14 Oct 2022, 11:13

Bjerrk wrote:
14 Oct 2022, 07:35
As I understand it, it mimicks the Pro Mini pinout rather than the Pro Micro!
This rings a bell. I looked into USB to USB, and therefore USB host shields, a few years ago when investigating making an internal converter for my Realforce. (I wanted to make it Bluetooth, which is more trouble still.)

The appropriately sized USB host shield the tutorials pointed to was long out of production, and I didn't know about these Chinese copies. Before I shelved the project I remember some big gotcha about the shield being for the Pro Mini and needing jumped around a bit for Micro. The smaller shield is effectively a shrunk down version of the widely available big shield, which was indeed aimed for a fatter project board.

I haven't revisited any of this since I bit the bullet and did all my mods with Karabiner.

caberolo

14 Oct 2022, 14:05

Bjerrk wrote:
14 Oct 2022, 07:35
I had (have, really) the same problem! In fact, I still have a non-functional pro micro/USB host shield wired up somewhere on my desk ...

Anyway, I think the source of the problem is explained here:
https://forum.arduino.cc/t/usb-host-min ... spi/314349

As I understand it, it mimicks the Pro Mini pinout rather than the Pro Micro!
From what I read in that post, it's a related problem, but it's not what I'm dealing with. It does indeed change the logical pin assignment, which has implications for firmware programming, but physically, the pins are in the same place on the promicro and the promini.

This is the assignment on the pro mini:
Image
Image
(from https://www.etechnophiles.com/arduino-p ... in-detail/)

On the other hand, I found a page (in Japanese, https://ht-deko.com/arduino/shield_usbhost_mini.html)[*] explaining the procedure with the promicro and the differences with the promini. The interesting thing is that in the pictures, the usb shield it uses is labelled like mine (and like most of the ones sold on aliexpress). In fact, I'd say it's exactly the same.

But I'm not sure yet if it's a labeling problem or the pins are really swapped.

Thanks for the help.

[*] It was in the OP's link, but being a Japanese page, I left it pending to read it.

User avatar
jsheradin

14 Oct 2022, 16:55

caberolo wrote:
14 Oct 2022, 14:05
But I'm not sure yet if it's a labeling problem or the pins are really swapped.
Have you wired it up yet? There should be no damage or anything if they're wired backwards. If it doesn't work, try swapping the lines around and try again.

If you want to be extra safe you can add a ~1kOhm series resistor on the data lines. You can also look up the pinout in the datasheet for whatever chip is on the shield and trace the pins back to it visually or with a multimeter.

Not sure what exact chip you have but here's the first one I found:
Capture.JPG
Capture.JPG (30.46 KiB) Viewed 3398 times

caberolo

22 Oct 2022, 17:15

jsheradin wrote:
14 Oct 2022, 16:55
Not sure what exact chip you have but here's the first one I found:
Capture.JPG
Finally, I was able to confirm that it is a labelling problem with the USB host shield. After reading your post, I looked up the diagram of my chip (which is the same one you linked to), and followed the path from the corresponding pin to its hole. Indeed, the UHS pins are correctly positioned and incorrectly labelled, as I suspected.

Also, I wrote to Deko (the Japanese guy I mentioned in the OP), who confirmed that the Chinese clones of the UHS must be mislabelled.

I soldered my UHS to the promicro, and it works perfectly. This is what it looks like:
UHSpromicro.jpeg
UHSpromicro.jpeg (167.92 KiB) Viewed 3301 times
Not the best soldering in the world, but it works.

Thank you all for your interest and help.

Best regards.

User avatar
Muirium
µ

22 Oct 2022, 19:06

Cool. What firmware’s running? Consider me intrigued.

caberolo

22 Oct 2022, 20:08

Muirium wrote:
22 Oct 2022, 19:06
Cool. What firmware’s running? Consider me intrigued.
QMK. It works flawlessly on promicros and is easy to configure, although they are a bit limited in memory.

I'm going to buy another shield, to see if it works with a RP2040 based microcontroller.

Post Reply

Return to “Workshop”