Killing the USB on Micro

Hi!

On a Micro, the USB communication is handled in the main processor instead of in a co-processor. I am trying to build a thing that uses a different sort of serial communication (LocoNet). If possible, I'd like to terminate the USB driver to free up resources, but not before it has sensed that there is no physical USB connection present.

This way, one could connect a PC to the board's USB socket for update- or debug purposes, but if no PC is present, the board would shut down the USB driver and continue with its normal programming (and thus the other type of serial connection).

Is this possible, or would it take a Wiz to code?

1 Like

Well very complicated process, hope you will find way out.
Will follow you. Good luck!

If you need more ressources use a more ressourceful microcontroller
depending on the number of IO-pins ypu need this could be a
Arduino-IDE programmable
Seeeduino XIAO 32 kB SRAM 256 kB FLASH

Teensy 4.1 1000 kB RAM, 7000 kB FLASH

best regards Stefan

Why not use a board that has an FTDI connector? Then you plug in the USB-serial adapter to program/configure, and remove after that. Pro Mini for example...

What exactly, is your resource problem? That might be easier to solve, than throwing solutions at it (I don't want to upset you, but the phrase that comes to mind is "band aid").

would it take a Wiz to code?

Depends on your definition of "Wiz" but it might be a kind of, "lf you have to ask, the answer is yes".

Not sure how many resources would be freed up, but there is a Serial.end() function that on other arduinos frees up the Tx/Rx pins for other uses. That particular part does not apply to an atmega32u4 since the Tx/Rx pins are already a separate serial port, but it may free up some ram since the rx/tx buffers are no longer needed.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.