Pages: 1 2 [3] 4   Go Down
Author Topic: External power to circuit while programming  (Read 1909 times)
0 Members and 1 Guest are viewing this topic.
Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 20
Posts: 1318
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

would a diode between each potential(!!) voltage source and Vcc do the trick?
each voltage source is protected from the other by a foward and reverse biased diode
so they should be ok
your circuit will take whatever power it can get!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 691
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

would a diode between each potential(!!) voltage source and Vcc do the trick?

Like a BAT 120C, for example? Up to 1A, 0.45V voltage drop at 1A, closer to 0.2V at 100mA. The Atmel chip can operate reliably at 4.5V @ 16MHz, but can the rest of your circuit? I presume that there wouldn't be issues with the FTDI cable either, 4.5-4.9V should be well above the trigger point for on vs. off. At current draws above minimal levels, consider thermal management carefully to keep the schottky dual diode cool.
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 20
Posts: 1318
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BAT 120C looks very neat!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not wasted I think, just cut the 5v line from the FTDI chip to the rest of the board and isolate the AVR TX signal. Also adding a connection as dc42 suggested is good if you want to detect the USB plug in.
They wouldn't be connected together to begin with, the FTDI would get its power from the USB bus, not the rest of the circuit.  As I mentioned, I only need it when the controller needs reprogramming, so I don't need it to remain powered up the whole time.  So I think I can get away with that, use the FTDI in a USB Powered Configuration, with a common ground shared with the rest of the circuit, which is powered by a separate 5V supply.

Should I be adding diodes on all three signal lines (TX, RX, DTR) between the FTDI chip and the Atmel to prevent the Atmel back feeding power back into the FTDI?

And what about using the FTDI's 3V3OUT pin connected to one of the Atmel's analog pins as a way to detect when a USB cable's been plugged in?  Since the FTDI only powers up when the USB cable gets plugged in, the 3V3OUT pin would only go high when it does.  So technically I should be able to read the analog pin and figure out if it's zero (OFF) or higher (ON).
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Should I be adding diodes on all three signal lines (TX, RX, DTR) between the FTDI chip and the Atmel to prevent the Atmel back feeding power back into the FTDI?

I would use resistors, not diodes, to give protection the other way round as well. 10K should be about right.

And what about using the FTDI's 3V3OUT pin connected to one of the Atmel's analog pins as a way to detect when a USB cable's been plugged in?  Since the FTDI only powers up when the USB cable gets plugged in, the 3V3OUT pin would only go high when it does.  So technically I should be able to read the analog pin and figure out if it's zero (OFF) or higher (ON).

Sure, you can use that mechanism, or you can connect USB +5v to a digital input as I suggested earlier.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would use resistors, not diodes, to give protection the other way round as well. 10K should be about right.
That would still allow voltage through, wouldn't it?  Or will killing the current have the same effect?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using 10K resistors will reduce the current to a safe value that the internal protection diodes can handle. Using diodes + pullup resistors, the diodes can only protect one way round, e.g. if they are connected the right way to protect the FTDI chip when the mcu is powered but the USB is unpowered, they won't offer any protection when the USB is powered but the mcu is unpowered.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Gotcha.  Thanks for the explanation.

So in staying with the FTDI, going over the USB Bus Powered Configuration section in the datasheet, and comparing it with an SFE FTDI Breakout Board, this is what I came up with.  Can someone please look this over and make sure I didn't screw up somewhere?

Keep in mind that the VCC/USB is just interconnected to the TX/RX LEDs, it's not connected to the main VCC for the entire circuit.

Also missing is the 10K resistors on the three signal lines going to the MCU.


* FTDI Circuit.png (14.98 KB, 1291x791 - viewed 11 times.)
« Last Edit: February 03, 2012, 05:04:49 pm by KirAsh4 » Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You probably know about putting a diode on the reset line but thought I would mention it just in case.

The other thing I was thinking about is the 3v3 line going to an analog port...you'll have to constantly poll the port to check the state. You could connect it to a hardware interrupt pin and use attachInterrupt(RISING) so you won't have to poll nonstop.

Other than that I like it, and may incorporate this into my own designs.

Chris
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've never added a diode on the reset line on any of my previous designs.  On the MCU side, there's a 10K pullup on it.  Same design as on a LilyPad which has the FTDI header broken out.

And you're right about the polling the analog port.  I did think about that last night and promptly forgot about it this morning ... I have 16" of snow on my mind (and it's still coming), this is my way of trying to "forget" about it ...
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would use resistors, not diodes, to give protection the other way round as well. 10K should be about right.

So DTR/RST line already has a 10K pull-up, so I just need to add two more pull-ups to TX and RX, right?  Should I have one on the 3V3OUT line as well, as that's now going to a pin on the MCU?
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've never added a diode on the reset line on any of my previous designs.  On the MCU side, there's a 10K pullup on it.  Same design as on a LilyPad which has the FTDI header broken out.

They added one in the Uno R3. I had problems where sometimes new sketches intermittently wouldn't start after upload, I had to reboot first. I posted this question here about a month ago and that was the response, I've seen others having the same problem too. Since adding the diode I've never had the problem.

The problem may be specific to the Optiboot bootloader...not sure...

See retrolefty's response here:

http://arduino.cc/forum/index.php/topic,79713.msg602793.html#msg602793

Or here:

http://arduino.cc/forum/index.php/topic,82833.0.html

Chris

Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, guess I'm one of the lucky ones that never encountered that, but then I'm still using the cores that came out with version 0022 of the IDE.  So maybe that's why.  Anyway, the new R3 board has a CD1206-S01575 in place.  I assume that's comparable to using a 1N4004?
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it may be related to the new bootloader (Optiboot) used in the 0023 & 1.0 IDEs for the Uno. I don't know for sure, but like you I don't remember having the problem or using a diode there until recently.

I'm not sure about the diode choice. I'm definitely a neophyte with circuits so in my designs I've just been using the S01575; it's cheap from Mouser ($0.06 ea) so I didn't put a lot of thought into it.

Hope this helps,

Chris
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm still not understanding the 10K resistors on the TX and RX lines, whether they need to be pullups or pulldowns.  The idea is that I don't get any transient voltage flowing TO the FTDI chip when there is no USB cable plugged in and the rest of the circuit is powered by the external 5V supply.

When I plug a USB cable in, the FTDI needs to be able to send data to the Atmel of course.
Logged

Pages: 1 2 [3] 4   Go Up
Jump to: