Electronic – Doubt about USB bus powered device

usb device

I want to improve my project to be more robust, because it needs to be available 24 hours a day. Initially, my design had one microcontroller and a USB (FT232R) interface. The FT232 is 5V powered and my microcontroller is 3.3V. I was using an external regulator to supply power to the microcontroller, but, to minimize possible issues that the approach of using two voltage sources can bring, I thought to use a bus powered solution.

I read on FT232's datasheet that the basic rules for USB bus powered devices are as follows:

  1. On plug-in to USB, the device should draw no more current than 100mA.
  2. In USB Suspend mode, the device should draw no more than 2.5mA.
  3. A bus powered high power USB device (one that draws more than 100mA) should use one of the CBUS pins configured as PWREN# and use it to keep the current below 100mA on plug-in and 2.5mA on USB suspend.
  4. A device that consumes more than 100mA cannot be plugged into a USB bus powered hub.
  5. No device can draw more than 500mA from the USB bus.

My concerns:

  1. Trying to satisfy this rule, I analyzed the current consumption of the microcontroller:
    The microcontroller is a dsPIC33EP64MC202, and it has the following current's consumption according to its datasheet:

    DC Characteristics: Operating Current(IDD) at +85°C 3.3V 70 MIPS:
    Typical ……………………………………. 41 mA
    Maximum ……………………………………. 60 mA

    Absolute Maximum Ratings:
    Maximum current into VDD pin …………………. 300 mA

    Considering the operating conditions, it seems to be ok to use a bus powered approach, but, I'm afraid of the absolute maximum current that it can draw and what could happens if it draws this amount of current. So, my doubt here is, should I consider a high power USB device or not? Would be safe to consider a non-high power USB device?

  2. I read what "Suspend mode" is, I understood that the host (the computer in this case) will decrease current when there is no activity on the bus for a time greater than a few milliseconds and, afterwards, it will decrease the current until shutdown the device.
    Well, if this is right, I have a problem here, my device will receive a requisition via USB and, after a time, a few milliseconds, it will answer the requisition. How can I handle with this? The device can not be shut down so early in the middle of an operation

  3. I did not understand this rule. If my device is a high power USB device, I should use one of the CBUS pins configured as PWREN# and use it to keep the current below 100mA on plug-in and 2.5mA on USB suspend. But how I will do this if my microcontroller is BUS powered? I need to configure the FT232 before mounting it on the PCB?

(4 & 5). The rule (4) is sufficient to rule (5), so, why specification on rule (5) was necessary?

Best Answer

Power specification in Absolute Maximum Ratings is a worst-case scenario when pretty much all pins are sourcing maximum current. Only you can tell whether it ever happens in your design. If it ever draws more than 100mA then you should configure max power in FTDI EEPROM.

All the configuration of the FT232 can be done via USB after mounting on PCB. The software can be downloaded from FTDI website.

There are two ways you can support low powered mode.

  1. Since you need to drop supply to 3.3V anyway you can use LDO with "enable" pin, controlled by PWREN/SLEEP. Another option to use power switch as illustrated in 6.3 of FT232 datasheet. This will cut power to your circuit, so you need to carefully plan your reset sequence.

  2. You can use low quiescent current LDO to always supply your MCU and use PWREN/SLEEP to put MCU to sleep or wake up. This method leaves your code in control over the process.

In either case, note that suspend signal from USB host usually means your computer goes into sleep/hibernation/shutdown. As such, your device should not expect any requests coming from PC until it is brought back from suspend.

On the other hand, this is two-way street. If your device has some data it wants to communicate to PC it can use remote-wakeup signal (supported by FT232) to get its attention.

Regarding decreasing power when bus is inactive - host does not do it. It is important to understand what this feature is for. It was introduced mostly for devices that have their active operation and USB communication inherently tied. For example keyboard or mouse need to communicate with PC when they are used, but can safely go to sleep as soon as you stop typing or moving.

If your USB device has something to do in between (e.g. data collection) it can continue doing so. It is quite common to use timer interrupts to wake up, do some sensor readings (e.g. temperature) and go to low-power mode again.