This is weird: USB keyboard works with connector, but not directly wired.
Starhawk wrote 04/20/2019 at 22:16 • 0 pointsI have a known good MagicForce 68-key keyboard. It comes with a cable and a USB Mini-B connector (NOT MicroUSB!).
If I use it with its original cable and connector, it works. I tried it once with another USB Mini-B cable and it did not work, but I believe that was a bad cable. I have since removed the connector and direct-soldered another USB cable to it and it doesn't want to work now -- but the cable I'm using it with is tested and known good.
What am I missing...?
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Turns out the missing shield was the issue. I found another pretty cable (I wanted a pretty one, that was the point) and it was shielded, so I used it instead. Keyboard works now.
Are you sure? yes | no
I doubt if it's interference that the shield is preventing but rather that they have used the shield as one of the lines.
Are you sure? yes | no
Maybe there's a chip inside the connector?
Are you sure? yes | no
I have been tinkering with V-USB with an ATTiny841 (using the Micronucleus bootloader) on a breadboard and encountered similar issues - when connected to my laptop with the USB2.0 hub on my desk it works fine, but using different, USB3.0 hubs or directly into a USB3.0 port, it just isn't recognised. I haven't had time to dive into it, but my guess is that some software USB implementations are not fully USB3 compliant. Using some hubs/cables (most likely USB2 hubs/cables) helps avoid these issues.
So it could be that the microcontroller in your keyboard is using V-USB and therefore isn't USB3.0 compatible. The cable that works might be a USB2 cable, that fixes (or hides) the incompatibility.
Are you sure? yes | no
As far as I know USB3 connector has actually 2 interfaces - USB2.0 with power D+/D- for backward compatibility and a separate USB3 RX & TX diff pairs and a ground. These two shows up as two separate ports under USBtreeview. USB3 hub similarly have two functional hubs in one.
http://billauer.co.il/blog/wp-content/uploads/2015/12/cypress-hub-controller.jpg
My ATMega VUSB uses a crystal works fine with USB3 port as well as a USB3 hub. May be the ATTiny VUSB with its RC timing is a bit outside of the tolerance of newer USB implementation? It was quite a bit of a hack as is.
BTW my $3 keyboard from a "Dollar store" works fine on a 3.0 port.
Are you sure? yes | no
It might be a timing issue, but V-USB is known to have incompatibilities with USB 3.0, even when using a crystal, especially on Windows computers it seems. Most posts I have found online about V-USB and USB 3.0 say to use a USB 2.0 hub as it just doesn't work reliably otherwise. I hope to get some time over the coming week to dig into this deeper and find out what is happening...
Are you sure? yes | no
It uses some non-standard pinout in both the PCB connector and the cable that cancel each other out?
Or, you didn't solder the cable right :-)
Just guesses, of course.
Are you sure? yes | no
Actually, after looking in dmesg on Linux... it doesn't appear to be fully USB compliant. The cable I'm using is an unshielded cable - meaning that the microcontroller should downshift from USB2 to USB 1.x, and it appears that it's not doing that downshift.
Are you sure? yes | no
Most cheap Chinese cables I have seen do not have shields. I have also made my own USB2 extension cables out of retwisting stranded cat5 patch cord pairs. They seem to work okay connecting a USB2 hub to PC host at high speed.
Are you sure? yes | no
In fact, if I've got the right datasheet, the microcontroller being used is abusing its I2C lines to run the USB data. The writing is very small on a very small chip, though, so I could be wrong. It could also easily be a counterfeit chip with the wrong label, or a custom OEM variant that's undocumented.
Are you sure? yes | no
https://www.cypress.com/file/134171/download
>A 1.5-kΩ pull-up on the D+ line indicates that the attached device is a Full-Speed device. A 1.5-kΩ pull-up resistor on the D- line indicates the attached device is a Low-Speed device.
>High-Speed devices start as Full-Speed devices, so they have a 1.5-kΩ pull-up on the D+ line. When the device is connected, it emits a sequence of J-States and K-States during the reset phase of enumeration. If the hub supports High-Speed, then the pull-up resistor is removed.
USB keyboards reverts to PS/2 if they detect pull ups (instead of 15K pull downs from USB host) on both lines. PS/2 is also bit-bang.
Generic lower end keyboards and similarly software bit-bang USB tends to be Low Speed device. They cannot be enumerated to Full Speed or High Speed by mistake.
Does the funny cable have a 1.5K (or higher) pull up hidden inside?
(Coincidentally, I also use I2C port on my ChibiTerm as PS/2 interface for keyboards because it was full 5V tolerant. I can't use it for anything else because it only has open drain.)
Are you sure? yes | no