I have a standalone ATMega328P chip (on a breadboard) with a Uno boot loader. Connected to it is this FDTI USB interface board. It's wired up as per this post:
But the "RTS" is called "DTR". On power up the DTR line is high. When I upload a sketch DTR goes low and triggers a reset. The RX and TX LEDs on the FDTI board light up and the sketch uploads. DTR stays low and subsequent sketch uploads attempts fail. The Reset never fires.
If I short the cap between DTR and Reset then most of the time it works. If I pull the USB cable out and put it back in DTR goes back to a high state and the next sketch upload attempt succeeds.
It looks to me like the FDTI board is not resetting DTR when it's done or the Arduino GUI isn't doing it. I tried this but couldn't get it to work and don't know enough about Perl to mess around with it.
I tried using a WiFi Uno with the chip removed as an ISP and it works fine. I also tried the chip from that Uno in the breadboard and get the same behaviour so I'm happy it's not the ATMega chip etc. I googled around and tried various suggestions from these places:
I have ordered a different brand USB interface board to see how that works out and I'm prepared to just use an empty Uno board as a programmer in the meantime, but I would prefer the smaller FDTI board if possible. Am I on the right track? Any help would be appreciated.
First thing I noticed is this: "Arduino UI 1.7.10"
Arduino.cc has no such IDE version. The latest full release is V1.6.11, and the nightly releases are V1.6.12.
You have the enemy's IDE, from 'Arduino.org'.
(This is an 'Arduino.cc' forum.)
Here, we all use the (better) 'Arduino.cc' IDE software. Because of this, it will be very hard for anyone here to help with your problem, if it is an IDE issue.
It might just be the USB to TTL converter anyway, but just in case it is an IDE problem, if I were you I'd check on the 'Arduino.org' forums.
Take a look at the original Arduino Uno schematic. As you can see, they add a pull-down resistor before the capacitor. I use the same schematic for my standalone ATmega28P's, using an FTDI board similar to yours, and I've never had this problem.
I use the design as is, no pulldown resistor, all the time with FT232 based USB/Serial adapters. Mine are from www.tinyosshop.com and the MIKROE-483 from Mouser for on-board applications http://www.mouser.com/ProductDetail/MikroElektronika/MIKROE-483/?qs=%2Fha2pyFadugsEwyLV5fFyIWdPbushEDhRSvnBE0ODG8%3D
Is your R1 really 10K, or something bigger (100K?)? Is your C3 really 0.1uF/100nF or something bigger (1uF?)
A weaker pullup, or a cap that takes longer to charge up after getting a level from the RTS/DTR signal, will make the reset last longer than needed.
OldSteve:
First thing I noticed is this: "Arduino UI 1.7.10"
Arduino.cc has no such IDE version. The latest full release is V1.6.11, and the nightly releases are V1.6.12.
You have the enemy's IDE, from 'Arduino.org'.
(This is an 'Arduino.cc' forum.)
Sorry about that, I didn't realise there were multiple communities and that they didn't get along. I installed Arduino.cc v1.6.11 and other than the splash screen it looks about the same to me (sorry). It even opened all the same sketches and other than reporting 'Invalid version found: 1.04' a lot, it does the same thing with the same errors. The errors do CRLF better though, so I'll use this IDE from now on.
PieterP:
Take a look at the original Arduino Uno schematic. As you can see, they add a pull-down resistor before the capacitor. I use the same schematic for my standalone ATmega28P's, using an FTDI board similar to yours, and I've never had this problem.
I added the 1k pull down but it didn't help.
CrossRoads:
I use the design as is, no pulldown resistor, all the time with FT232 based USB/Serial adapters. Mine are from www.tinyosshop.com and the MIKROE-483 from Mouser for on-board applications http://www.mouser.com/ProductDetail/MikroElektronika/MIKROE-483/?qs=%2Fha2pyFadugsEwyLV5fFyIWdPbushEDhRSvnBE0ODG8%3D
Is your R1 really 10K, or something bigger (100K?)? Is your C3 really 0.1uF/100nF or something bigger (1uF?)
A weaker pullup, or a cap that takes longer to charge up after getting a level from the RTS/DTR signal, will make the reset last longer than needed.
I'll buy one of those and try it too. Resistor colour bands are brown black orange for the 10k and it has 104 on the ceramic cap.
Not sure if I mentioned but I tried the circuit on 5v and 3v3 - there's a switch on the USB board and I'm using that to power the ATMega too. DMM says those voltages are as expected and I have a number of decoupling caps around the breadboard.
I'll investigate getting a digital scope organised over the weekend and see if I can capture the DTR line. I'll also strip and rebuild the breadboard and post some pics just in case there's something dumb I'm doing.
kristakis:
Sorry about that, I didn't realise there were multiple communities and that they didn't get along. I installed Arduino.cc v1.6.11 and other than the splash screen it looks about the same to me (sorry). It even opened all the same sketches and other than reporting 'Invalid version found: 1.04' a lot, it does the same thing with the same errors. The errors do CRLF better though, so I'll use this IDE from now on.
I didn't really think it would be an IDE problem, but thought I'd better mention it. And the "Arduino.org" IDE seems to have a lot more problems, from what I've heard.
Regarding that warning "Invalid version found: 1.04", it's caused by the version number of one of your installed libraries being incorrectly numbered. Should be 1.0.4. Edit: or 1.4
It's nothing to worry about, merely a warning, but there's more info here:- 1.6.11 - Invalid version found: 1.04 [solved]
I added the 1k pull down but it didn't help.
No, I pretty well knew that wouldn't help. Since the problem is the DTR line staying low, also pulling it low with a resistor wasn't likely to help it to return high.
I'll buy one of those and try it too. Resistor colour bands are brown black orange for the 10k and it has 104 on the ceramic cap.
That's fine, they're definitely 10K and 0.1uF.
I'll also strip and rebuild the breadboard and post some pics just in case there's something dumb I'm doing.
Probably a good idea. And double-check all connections as you do so. If you still experience the problem, it's almost certainly a dud USB to TTL converter. I personally usually use CP2102-based converters, but there's nothing wrong with the FTDI variety usually.
Try connecting an LED to the DTR pin of the FTDI module, just an LED and a series resistor - thanks OldSteve - so disconnect it from the ATmega. Upload a sketch (by manually resetting the chip) and see what the LED does: it should be on before the upload, then it should go off while uploading, and then light up again when it's finished.
If it doesn't light up again, you know that it's probably a problem with the FTDI board, driver or Arduino IDE. If it does go high again, then you should suspect your circuit.
But as far as I can see, your circuit is ok, so it's probably a software bug. Do you have a different computer you can try it on, maybe with fresh drivers, and a fresh install of the Arduino.cc IDE?
I sometimes use GTKTerm, a serial terminal (I use Ubuntu, but I'm sure there's alternatives for Windows as well) for debugging, and it has the option to manually change the state of the DTR pin. Does this work for you?
PieterP:
Of course, it's so trivial I forgot to mention it, I'm sorry.
Just thought I'd better say something.
Also, I wasn't sure if the DTR pin was driven high, or if it was held high by a pullup resistor, (in which case a resistor probably wouldn't be needed), but better to be sure than sorry afterwards.
PieterP:
Try connecting an LED to the DTR pin of the FTDI module...
But as far as I can see, your circuit is ok, so it's probably a software bug. Do you have a different computer you can try it on, maybe with fresh drivers, and a fresh install of the Arduino.cc IDE?
I sometimes use GTKTerm, a serial terminal (I use Ubuntu, but I'm sure there's alternatives for Windows as well) for debugging, and it has the option to manually change the state of the DTR pin. Does this work for you?
I hooked up a LED and watched it go low for the sketch upload and just stay low. I updated the drivers and tried different USB cables and ports. Then I popped it onto a Windows Laptop and it worked. So I rebooted the mac into Windows and it worked. Then I booted back to macOS and it worked.
I really should have tried a reboot first. Thank you everyone for your help and suggestions!
Now that uploading sketches is working, I added an enc28j60 and have it connecting to a TCP server. Here's a pic if anyone cares Now I gotta design the PCB and look for 50R resistors.