0
\$\begingroup\$

I made a prototype board of data acquisition and powered it like in the schematic below:

enter image description here

This is a simplified schematic.

There is a USB port that provides power for the whole board; a FT230 for the USB-UART conversion; a ST6600 for smart button functionality; a LDO-3.3V to power the microcontroller (PIC32MZ).

When I press the button, the ST6600 assert the signal that enables the LDO-3.3V and so the microcontroller.

But here I have a little trouble: if I plug the USB cable and NOT press the button, the LED on the output of microcontroller turns on feebly. So I noticed that the problem is due to the RX and TX signals which from the FT230 are connected to the microcontroller. These signals go to 3.3V when the USB is plugged and, even if the microcontroller is off, there is a current that flows inside it and goes out on the output of the LED; I can even read a 1.8V on the 3.3V net of the circuit.

Is this a normal behaviour (maybe I made mistake with this schematic) and if so, can anyone explain me why of the output current and the 1.8V?

\$\endgroup\$
  • 2
    \$\begingroup\$ You shouldn't be feeding active logic lines to a pic when it is unpowered. Read the data sheet. \$\endgroup\$ – Andy aka Mar 11 '17 at 19:45
  • \$\begingroup\$ CBUS0 might be the answer. A quick read of the DS implies it might be able to inhibit TXD. \$\endgroup\$ – Andy aka Mar 11 '17 at 19:57
  • \$\begingroup\$ If two IC's are connected together by IO lines, and one of the IC's is powered off, the device which is powered on MUST set the IO lines to a high impedance state, or drive them low. The connected lines must not be driven high or pulled high by internal or external pullups on the device which has power. There are exceptions, but when they apply, the datasheet will note it because they are rare. \$\endgroup\$ – mkeith Mar 11 '17 at 20:59
  • \$\begingroup\$ This feels very much like you should definitely drop the FT230 and use a microcontroller that comes with USB embedded. And frankly, I'd drop the STM6600, too, and just let the microcontroller sleep and wake up on a interrupt line from the button (and then debounce in software). A modern LDO will draw very little more than the STM6600's standby current and the microcontroller's deep sleep current will usually be neglectable, so you'd be saving two components, and get better performance (a UART converter is not meant for data acquisition, imho, since you're restricted to strange rates) \$\endgroup\$ – Marcus Müller Mar 11 '17 at 21:02
  • \$\begingroup\$ And, your microcontroller already comes with USB, so why the USB-UART converter at all? \$\endgroup\$ – Marcus Müller Mar 11 '17 at 21:03
2
\$\begingroup\$

Except for the 5 V-tolerant ones, the MCU I/O pins have an internal protection circuit. This consists of a diode between the I/O pin and 3V3 (A on I/O, K on 3V3) and another diode between the I/O pin and GND (A on GND, K on I/O). The idea is that voltages above something like 3.7 V cause the upper diode to conduct and dissipate the energy into the 3V3 rail, while voltage below about -0.4 V cause the lower diode to conduct and dissipate the energy to GND. It protects the IC against transients and other limited-energy pulses and this circuit is common in logic ICs.

schematic

simulate this circuit – Schematic created using CircuitLab

In your case, the microcontroller is unpowered but the USB-UART IC is driving a microcontroller I/O with its RXD output voltage. This voltage is high when RXD is idle, which for your UART is probably far more often than not at the moment. So RXD drives the microcontroller's 3V3 rail through the upper diode of its RB5 pin. This puts your microcontroller 3V3 to a mid-rail voltage well below operating level and drawing more current than RXD can supply untroubled. I would venture that it results in the microcontroller semi-functional erroneously driving your LED output weakly high.

If you connect RXD to the microcontroller as shown below, it should have no further problems.

(If I have the USB-UART IC pins named the wrong way around, the above text expects RXD to be the 'USB receives data' pin and therefore that RXD is an output of that IC.)

schematic

simulate this circuit

\$\endgroup\$
  • \$\begingroup\$ This is the answer that I wanted. Thanks. I found another solution that maybe is more simple: connect the #RESET pin of the FTDI to the signal that enable the LDO. I tested it and seems to work nice. \$\endgroup\$ – thoraz Mar 14 '17 at 11:18
  • \$\begingroup\$ @thoraz, I used a couple of FTDI devices and used their PWREN# output to establish the bus state. It's asserted once USB has connected and enumerated and is out of standby. Might be of interest. In standby, USB 2 devices are supposed to draw 500 uA max, as you probably know. Glad it helped, good luck with it all. \$\endgroup\$ – TonyM Mar 14 '17 at 11:36

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.