Forum Index > Projects > Other projects
 Using a FTDI serial cable and uploading Arduino sketches to the target board
 |  Printable Version
By: q209 (offline) on Tuesday, December 20 2011 @ 09:58 AM PST (Read 5227 times)  
q209

I'm playing with a target board with a 328 loaded with the Arduino bootloader. (that went fine using the usb tiny programmer). After going through many program iterations, I tired of popping off the CPU every time I wanted to reload it - and, besides, I don't have an Arduino board with a ZIF socket...

So. Hey. Can't be hard to add the stuff to plug in the FTDI cable, right? A header, 10k resistor, 100nF cap, a couple of wires, and...

Yeah. "avrdude: .... programmer is not responding.". The LED on digital pin 13 flashes a few times when I try to upload the sketch, but then always the error.

Other than this, everything is working as expected. Just can't upload.

On the FTDI header: Pin 1 to ground, 2 and 3 no connection, 4 to RXD, 5 to TXD, 6 through the cap to the resistor and Reset. The other leg of the resistor goes to VCC.

Note: I've tried every '328 board type in the Arduino Tools->Board list. Same result.

Suggestions, other than buying a box of Diavolinos? Trying to go DIY and cheap here!

Thanks -

Kevin


Forum Henchperson
Henchperson


Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Tuesday, December 20 2011 @ 11:04 AM PST  
Windell

First: Which bootloader? The Uno bootloader is not compatibl ewith the FTDI cable; you need to make sure that it's burnt with the older, "duemilaove" bootloader.

Second: Most, maybe all, of the Arduino variants require an 8 or 16 MHz crystal or ceramic oscillator to function correctly. That requirement is set by the fuses, when you flash it with the usbtiny.

It is possible to use the usbtiny to set the fuses such that a crystal is not required, and it is also possible (and easier, in fact) to program your "arduino" directly through the USBtiny, rather than using an FTDI cable.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Tuesday, December 20 2011 @ 01:32 PM PST  
q209

Windell -

Thanks for the reply!

I used the Arduino IDE "Burn Bootloader with USBTiny ISP". My default board is the Dumilanova with ATmega 328. I had tried the others in an attempt to load the sketch, not burning the bootloader.

The target board has your crystal/cap set installed. I've verified that it's working with a 'scope, and it's running just a hair under 16 mhz.

I've not tried loading an Arduino sketch directly with avrdude. Working in verbose mode, it looks like the IDE invokes it like this:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/tty.usbserial-A400hB50 -b57600 -D -Uflash:w:/var/folders/rb/c599pbh13bz1199gpyvpk8zr0000gn/T/build8707599045630199747.tmp/Program_Being_Worked_On.cpp.hex:i

Does this seem correct? Substituting the USBTiny, of course... and dumping the extra verbose flags...

Looking at how it invokes all of the complies it does leads me to believe it's better to let the IDE do that part.

Any additional suggestions, guides, comments, and commiseration?

Thanks -


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Tuesday, December 20 2011 @ 02:25 PM PST  
Windell

Hmm... yes, it does all sounds basically correct, with the Duemilanove bootloader and crystal and caps and all, especially since you're seeing "pin 13" blinking and, apparently correct resetting. I'll feel silly if I'm missing something basic here.

The avrdude command line that Arduino is issuing looks correct. The resetting indicates that the cable is correctly oriented, correctly addressed (the computer sees *that* cable) and that the auto-reset circuit is probably working correctly.

The fact that it dies after this indicates a likely connection problem on RX/TX. Is that cable known to work elsewhere? The wires sometimes break near the rainbow end, so you might check it visually, too. And, trace the wiring one more time to be sure.

You might also look at our serial communication article to double-check connections:
http://www.evilmadscientist.com/article.php/avrserial


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Tuesday, December 20 2011 @ 05:52 PM PST  
q209

Well, I *am* stubborn, so I've been trying a bit more...

Changed CPU's with a working boarduino. The boarduino works - and communicates - correctly. It uploads with the same program and cable.

Stuck a scope on the target board rx pin. Definitely see "stuff" coming down the pipe.

Stuck it on the tx pin. See a lot less, but still some.

Ran the Arduino IDE load in verbose mode (hit the shift key on the upload button click). It appears to be communicating with the target board, and it claims that it writes 6620 bytes of flash. When it goes to verify, however, after the first bit of handshaking we get the "not responding" message.

I've tried resoldering all of the relevant connections. Even replaced some hookup wire.

FInally, I note that the failure happens in different places. Sometimes at verification, sometimes after the first few bites. Sometimes somewhere random in between.

While my environment isn't EMF/RFI *clean*, my radios are off, and bare scope leads aren't showing wondrous and strange stuff in the ether.

Strange stray capacitance? Invisible EMF gremlins?

In frustration, I've even taken a quick pix in case there's something "duh!" going on... http://www.flickr.com/photos/q209/6546454095/

Please send meds.

Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: q209 (offline) on Wednesday, December 21 2011 @ 11:34 AM PST  
q209

Shoulda looked more at the pix myself.

Sat there thinking... long leads from the power supply... and there *is* space for some decoupling caps, even though Windell doesn't use 'em, by his own admission... :-)

OK, hook up the scope. Hmm... 120 - 140 mV peak, at around 30 to 42 kHz. Spikes. Not a lot compared to some I've seen, but hey. So, let's solder in a .1uf (104) cap.

Well. Now.

That was all it took? (down now to around 50-50 mV, up at 10MHz and above. Very regular, not spiky.)

Blushes, slinks from room, mumbles about time wasted that should have been used building presents...


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Wednesday, December 21 2011 @ 11:52 AM PST  
Windell

Ha! That actually was my guess-- but I hadn't gotten around to the forums yet today. Big Grin

(And yes, decoupling caps are often *very* important-- many of our kits come with buckets of them. One of their most important functions is to prevent momentary power glitches that interfere with writing flash, as it turns out.)


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   



 All times are PDT. The time is now 04:02 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?