how to write a hid keyboard firmware with "low speed"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to write a hid keyboard firmware with "low speed"

539 Views
auftrag2021
Contributor III

Hardware: imxrt1170 EVK

IDE: MCUXpressor 11.7.1

SDK: 2.13.1

Imported example: evkmimxrt1170_dev_composite_hid_mouse_hid_keyboard_bm_cm7

the example itself is good, when I run it, I can see the rt1170evk play a role like mouse and keyboard which communicate with my PC usb host.

 

But my intension is learning the USB low level driver in very detail (signal in physical layer). Unfortunately I don't have any high-end oscilloscope to see the high speed (480MHz) eye diagram. That's why I want to degrade the USB speed in this example from HS to FS or better LS.

 

anyone can help to figure out how to setup the speed in the code?

0 Kudos
2 Replies

491 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @auftrag2021,

Neither of the USB cores support running on Low Speed when in peripheral (or device) mode, as described on section "62.2.2 Features" of the Reference Manual.

That said, you can set the USB core to run at Full Speed by setting the Port Force Full Speed Connect (PFSC) bit of the Port Status & Control (PORTSC1) register. That is bit 24 of this register. In the enumeration process, the device and will negotiate with the host to achieve the highest port speed by default, but setting this bit will prevent this. So, set this bit before the device is enumerated, and once connected you should see it running at Full Speed.

BR,
Edwin.

0 Kudos

480 Views
auftrag2021
Contributor III

thank you so much for the feedback

as you mentioned: the LS is really not supported by the USB controller core0/core1

auftrag2021_0-1690323662530.png

 

I made a study in detail and finally figured out why:

The both USB transmitter don't have any pull-up option for D- line, which is required for LS detection. What a pity!

auftrag2021_1-1690323752988.png

as you mentioned, we could force the bus working with FS

auftrag2021_2-1690325023739.png

 

but I still have one thing not clear, should we activate the 1.5k pull-up resistor in USBPHY layer right?

I think it should be mandatory for the FS detection

auftrag2021_3-1690325246827.png

 

 

0 Kudos