1
\$\begingroup\$

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?

\$\endgroup\$
  • 1
    \$\begingroup\$ It's worth noting that most PCs will not care about current drawn from USB unless you exceed those 500 mA. So if this is a personal project most likely you will be fine. \$\endgroup\$ – Jan Dorniak Jun 15 '18 at 22:52
2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Well, so, it is not an obligation to enter in power save mode to reduce current consumption ? I have an LDO here, but it has not an enable pin, I was thinking to use it to regulate from 5V to 3.3V. What implications, of not enter in power saving mode to reduce current , other than energy consumption ? \$\endgroup\$ – Daniel Jun 18 '18 at 12:33
  • 1
    \$\begingroup\$ Let's put it this way, if you were making commercial product and wanted to put "USB" anywhere on a box you'd have to follow the rules and support low power mode. For personal project you can get by without it, however keep in mind that when PC is asleep the PCU stops the fan while still providing USB power. If you keep drawing too much it might overheat. Putting MCU to low-power mode is actually not that hard, you can add this later when everything else works. \$\endgroup\$ – Maple Jun 18 '18 at 13:21
2
\$\begingroup\$

I'm afraid of the absolute maximum current that it can draw and what could happens if it draws this amount of current.

Absolute maximum ratings are "if this is exceeded then the device may be damaged", not specifying that they will happen. You do not need to worry about that number. You do need to make sure that your current draw is under 100 mA or 2.5 mA when applicable by making sure the actual current draw due to program execution, internal peripherals, and attached devices does not sum up to over the USB-specified limit.

  1. I understood that the host (the computer in this case) will decrease current …

No. The USB host cannot "decrease current" because it is supplying a specified voltage. What this means is that when your device is commanded to suspend, according to the USB protocol, it must reduce its current draw or be in violation of the spec.

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

4 applies only when your device is plugged into a bus-powered hub. If it is plugged directly into the host then there is no bus-powered hub involved, and the 500 mA limit applies.

\$\endgroup\$
1
\$\begingroup\$

The absolute maximum rating is not a promise that the part will never draw more than 300 mA. It's a warning that if you put it into a state where it draws more than 300 mA, you could damage the part.

You, as the designer and firmware writer, are responsible for connecting the microcontroller correctly, and writing firmware that doesn't draw more than 100 mA at start-up, doesn't draw more than 2.5 mA in suspend mode, etc.

I understood that the host (the computer in this case) will decrease current when there is no activity on the bus...

The host can not unilaterally decrease the current drawn by your peripheral. It can only tell the peripheral to enter suspend mode. It's your responsibility to reduce the current below 2.5 mA when you're told to enter suspend mode.

Normally you'd do this by putting your micro into a sleep mode.

The device can not be shut down so early in the middle of an operation

As you said, the host will only request suspend mode when there has been no activity on the bus for several milliseconds. It won't happen in the middle of an operation.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.