This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2231: Resetting via DTR to capacitor to /RST

Part Number: MSP430G2231

I'm working on embedding a CP2102 USB-to-serial adapter in a G2231 project to allow BSL flashing of new firmware without using a Launchpad.  While the CP2102 has a 3.3V regulated output, it may be simpler, depending on the circuit, to let the G2231 be powered from its own regulator during the BSL process.  But that would require providing a way for the CP2102 to reset the G2231 so it could come back up in BSL mode.

I can't just connect the DTR output of the CP2102 to /RST because when the CP2102 is powered down, all of its lines sink significant current, and that would keep the /RST pin low.  So what I see used in various Arduino projects is connecting DTR to /RST through a capacitor.  That lets the flashing software bring the DTR line low briefly to initiate the reset, then back high, but there is no direct DC connection.  The docs say I can have a 2 nF cap from /RST to ground without interfering with SBW, but I would have that going to DTR instead, which when powered down would essentially be ground.  Of course I would need to make sure that's enough capacitance to overcome the 47K resistor long enough to trigger a reset.

My question about this is what happens when DTR goes high when the USB cable is plugged in, or suddenly goes back high after the reset is initiated.  In theory, that would present up to a 6.6V spike at /RST.  Is the idea that the protection diode will dissipate the excess voltage back into Vcc?  And for a chip that uses so little power, would that cause Vcc itself to spike above its absolute maximum?

It seems to me that the only really safe way to do this is add a (Vcc + .2V) zener diode from /RST to ground, but I would sure hate to do that if it's unnecessary.  As  practical matter, should I just not worry about such a small spike?  Apparently that works for Atmels.  What do you think?

  • I don't understand what you want to do. USB / UART bridge that is used for BSL interface already have possibility to RESET target device. After port close bridge should leave TEST low and RESET high.

  • The triggering /RST and Test pattern is for MSP430 parts that have BSL code built in, which the 2231 does not.  For what I'm doing, DTR and RTS aren't used at all in the protocol, but the 2231 needs to come up with its RXD line high when BSL is to be run.  In any case, I'm trying to embed the bridge in the circuit, which means it would be powered down when the USB cable is not connected to the PC.  And when it is powered down, it will ground the /RST pin if directly connected.  The 3.3V, TXD and RXD lines also sink current when powered down, but I can connect them through diodes and eliminate any problems.  But DTR to /RST is more difficult.

  • It will be much clear if you can attach schematic/picture for this. I guess that 2231 is run on battery, and you want to have possibility to sometimes update it by custom UART BSL by CP. And if CP is not powered there is some current leakage between 2231 and CP. Without any schematic/picture I can suggest to use some of 1 or 2 gate lvc member (small size, low cost), with DTR/RTS from 2102 on input side and 2231 pins on output. lvc will be powered from CP, and in case of power down lvc outputs will be high-Z.     

  • zrno soli said:

    It will be much clear if you can attach schematic/picture for this. I guess that 2231 is run on battery, and you want to have possibility to sometimes update it by custom UART BSL by CP. And if CP is not powered there is some current leakage between 2231 and CP. Without any schematic/picture I can suggest to use some of 1 or 2 gate lvc member (small size, low cost), with DTR/RTS from 2102 on input side and 2231 pins on output. lvc will be powered from CP, and in case of power down lvc outputs will be high-Z.     

    I've never had any luck uploading pictures here.  But yes, when the CP is powered down, and you apply an external 3.3V to the 3.3V output pin, TXD or DTR, you get about 9 mA of current flowing.  For RXD it's closer to 13 mA.  So it doesn't behave well when shut down. 

    I got the same advice as yours on an electronics newsgroup - it was actually to use an analog switch, but my reaction was that if I was going to use another chip, a hex non-inverting buffer would be better, and probably a lot cheaper.  The one I found was the MC74VHCT50A.  The datasheet says clearly it has power-down protection on both inputs and outputs.

    I was hoping to avoid using an extra chip, but I'm up to at least three diodes and a resistor without even addressing the DTR issue.  So it looks like the VHCT50A, which would be a SOIC part that could still be used on a through-hole board, is now the smallest, easiest and cheapest solution, at 40 cents.  That's assuming it really is Hi-Z everywhere when powered down.  I'll order some and see about that.  The characteristics of an IC when powered down isn't normally something manufacturers devote much thought to, but maybe I'll get lucky on this one.

    But that would give me DTR, RTS, TDX, RXD, and dual gates for 3.3V power (it sources up to 8 mA per gate, so that would be plenty).  Or, the flashing could be powered by the battery.  Either way would work.  And.the hex buffer would be powered by the CP, so its only effect on the circuit the 99.9% of the time when the USB cable is NOT connected would be limited to what I hope is nA leakage currents.

    So I think you're right, and I just need to give up on all the diodes and capacitors.  Then after connecting the USB cable, the PC software would just toggle the DTR line low, then back high, to reset the 2231 and make it come up in BSL mode.

    I've got all the software for both ends written for this, and it is very similar the suggested TI custom BSL for the 2231, except that if the PC deliberately sends the wrong byte as the activation byte, the 2231 will respond by sending a NACK.  So the PC can do a few trial handshakes like that to make sure the lines are working before sending the right byte.

     

  • George Hug said:
    The one I found was the MC74VHCT50A.  The datasheet says clearly it has power-down protection on both inputs and outputs.

    This one is OK. Working on 3.3V and high-Z on pins during power off.

    George Hug said:
    But that would give me DTR, RTS, TDX, RXD, and dual gates for 3.3V power (it sources up to 8 mA per gate, so that would be plenty).  Or, the flashing could be powered by the battery.  Either way would work.

    Yes, during flashing device can be powered by bridge. I guess that 10 mA is more than enough, but to be 100% sure you can measure it.

    However, in this case I am not sure how battery can be isolated from bridge voltage, except non-efficient way, with low-drop voltage diode. 

  • zrno soli said:
    George Hug
    The one I found was the MC74VHCT50A.  The datasheet says clearly it has power-down protection on both inputs and outputs.

    This one is OK. Working on 3.3V and high-Z on pins during power off.

    George Hug
    But that would give me DTR, RTS, TDX, RXD, and dual gates for 3.3V power (it sources up to 8 mA per gate, so that would be plenty).  Or, the flashing could be powered by the battery.  Either way would work.

    Yes, during flashing device can be powered by bridge. I guess that 10 mA is more than enough, but to be 100% sure you can measure it.

    However, in this case I am not sure how battery can be isolated from bridge voltage, except non-efficient way, with low-drop voltage diode. 

    In the circuit I'm working on, it's a 9V battery going to a 3.3V regulator.  If that power source is turned off, then the bridge can provide power to the 2231 so long as any current sink out through the regulator isn't too much.  Using an MCP1702, I find that only 0.1 mA flows back through the regulator ground pin.  But I suspect a lot more would flow back through the IN pin if the 9V power does other things in addition to powering the regulator. But as a general question, you would just have to measure and see how much current flows.  A diode in the OUT line of the regulator would not be acceptable, as you say, but a diode in the IN line might work if that's where the problem is.

    I think it will be better for the bridge to supply the power if there's not too much leakage. Then when the cable is disconnected, the power will be off.  If the battery provides power, things might become complicated.

**Attention** This is a public forum