Arduino micro - configure to low speed USB

Hi, currently when connecting my Arduino micro it identifies in the computer as USB Full Speed. For test needs, I would like to configure it to be USB Low Speed. Is that possible? Or is any other board is USB Low Speed and can be configured as a keyboard?

Thanks :)

Which program gives you that speed identification? Why bother with it?

Much more important is changing the Micro from a Serial USB slave into a Keyboard slave. See the many examples in the web and forum, and prepare to buy an ICSP programmer for revoking your Micro from a keyboard back into an Arduino.

DrDiettrich:
Which program gives you that speed identification? Why bother with it?

USB tree view gives me this information

DrDiettrich:
Much more important is changing the Micro from a Serial USB slave into a Keyboard slave.

With Arduino micro it is not really a problem as it can be configured to a mouse/keyboard without a problem.

I only need it to be a low speed connection. I managed to make it identify as usb low speed by editing the USBCore.cpp file:
adding a line UDCON = (1<<LSM);//Low Speed mode
to the USBDevice_::attach function.
while this did show as usb low speed my windows said it is an unrecognized device and my code stopped working (the code is just printing hello world).

So how do I do it without this problem?

You did not answer "why bother"?

It may be a Windows problem, i.e. you may have to install an according driver.

DrDiettrich: You did not answer "why bother"?

It is for test needs. I want to test both full speed devices and low speed.

As I recall, low vs. full speed is signalled by a pull up or pull down on one of the USB data lines. See if Atmel has any information on configuring the native USB port for low speed.

Or try VUSB because it bit bangs USB at low speed. However, VUSB is not the same as a full implementation of USB so it may not work for all USB hosts.

gdsports: Or try VUSB because it bit bangs USB at low speed. However, VUSB is not the same as a full implementation of USB so it may not work for all USB hosts.

Yes I perfer not using the VUSB becuase of that reason

gdsports: As I recall, low vs. full speed is signalled by a pull up or pull down on one of the USB data lines. See if Atmel has any information on configuring the native USB port for low speed.

What is that Atmel that keeps coming up?

thanks

What is that Atmel that keeps coming up?

Atmel are the manufacturers of the processor chips that are in most models of Arduino.

Atmel WAS the manufacturer of the AVR chips. They were aquired by microchip a year or two ago, so you now need to look at Microchips website for the data sheets and app notes for the “atmega32u4”, which is the chip used on the Arduino micro.

Despite their ownership by Microchip there is still a lot of Atmel websites around, at the moment they are keeping the Atmel brand.

I looked up the datasheet of the atmega32u4. According to this, in order to configure the USB to be low speed, you need to set the LSM bit in the UDCON register. datasheet page 281. I set the bit in the USBCore.cpp file in the clock_enable function.

After I do that I get "unrecognized device", but I'm still able to see it is low speed in the usb tree view. So first of all, how can I upload a new sketch if my board is not recognized, because currently I can't use my board anymore? Second and most importantly, what am I missing?

Double click the reset button to get into upload mode. Another feature of low speed USB is the max packet size is 8 bytes versus 64 bytes in full speed. You may need to rework the USB code to use 8 byte packets.

gdsports: Double click the reset button to get into upload mode.

Great thanks, that worked

gdsports: Another feature of low speed USB is the max packet size is 8 bytes versus 64 bytes in full speed. You may need to rework the USB code to use 8 byte packets.

Do you have any idea how do I do that?

The only way is to review all the USB source code. This is a non-trivial task.