Optiboot with FTDI Problems..

Just need a little help here. I recently bought an Arduino UNO board, and had a couple of blank 328 chips.. so after digging through the forums I found out how to get the UNO to work as an ISP, and have successfully used it to write the boot loader to the blanks.

Problem is in the past I had used an FTDI cable to program standalone atmegas that had the old boot loader, and it worked wonderfully.. it saved me tons of time from having to swap chips, blah blah blah..

So now if I try to use my FTDI cable on a 328 with the optiboot boot loader.. I get errors in the IDE where it cannot communicate with the chip.. I know people are doing it with the new boot loader, and I am just missing something small.. can I get a few pointers?.. I read a couple of posts on here about the issue, but it hasn't gotten me very far at the moment.

Thanks!

and have successfully used it to write the boot loader to the blanks

Using the Arduino IDE or avrdude from the command-line?

So now if I try to use my FTDI cable on a 328 with the optiboot boot loader.. I get errors in the IDE where it cannot communicate with the chip.. I know people are doing it with the new boot loader, and I am just missing something small.. can I get a few pointers?.. I read a couple of posts on here about the issue, but it hasn't gotten me very far at the moment.

What board type are you selecting to upload to the standalone chip? You have to use the Uno board selection as that is only one that has the correct baudrate that the uno bootloader uses.

Lefty

Arduino IDE… I don’t have a lot of experience with avrdude… should probably move that way, but the arduino IDE has kept it simple, so I would like to stay with it if I can for the moment.

Yes, I do have the UNO selected when I try to upload the sketch with the FTDI cable. No luck :frowning:

WiredUp: Arduino IDE.. I don't have a lot of experience with avrdude.. should probably move that way, but the arduino IDE has kept it simple, so I would like to stay with it if I can for the moment.

Yes, I do have the UNO selected when I try to upload the sketch with the FTDI cable. No luck :(

Well next step would be to perform the loop back test on the FTDI cable (jumpering rec and xmit pins) and see if the cable is still functional.

Lefty

avrdude: stk500_getsync(): not in sync: resp=0x30 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

This is what I receive as an error in the IDE..

Cable tests out fine.. it came off another known working piece of equipment. It's just a USB to TTL serial cable.. I don't see why it shouldn't work.

How do you have the auto-reset circuit wired?

10uF capacitor connected from reset to ground.

WiredUp: 10uF capacitor connected from reset to ground.

Huh, that's the method used to defeat auto-reset, not to allow it to function for uploading?

Lefty

Yea, your right.. ok, so I was a little confused/feeling dumb there.. umm, well then I dunno is the answer to the previous question. Been trying to use the cable to interface with a boarduino unit.. its basically a chip, clock and power circuit with a header for a inline 6 pin connector for the cable.. lemme to some research on the auto-reset and get back with an answer or fix for that matter.

So I'm confused.. do you mean how the reset signal comes from the cable to the actual chip?.. In the past all I had to do was wire RESET to the DTR pin on the cable, then GND to CTS/GND pins, VCC to VCC, and then just RX to RX and TX to TX.. its was pretty straight forward.. the reset signal was sent directly from the cable.. never needed any other circuitry other than the basic omron type switch for manual reset.

Ok, so I decided to look up the schematic on the boarduino and found they were using a 0.1uF capacitor in series with the DTR/RTS line to the reset pin.

Ok, so I built a barebone circuit on the breadboard.. one of my boot loaded chips.. power is coming from the UNO board.. built the clock circuit, manual reset circuit and the FTDI cable pinout circuit.. connected the 0.1uF cap in series with the RTS/DTS line from the cable to the reset pin.. I have a LED on pin 19, and when I try to upload I can see it blink momentarily.. I know its trying I just can't figure out why it won't upload properly.. I have tried switching RX/TX pins just as a sanity check.. but nothing works.. :(

Clock frequency = 16MHz?

20 MHz. Resonator.. is that a problem?

You will need to adjust the baud rate in the boards.txt file. 115200 * 20 / 16 = 144000

uno.upload.speed=115200 Is this the line I am changing in the boards.txt file? I changed the value to 144000, and now I can upload to a chip.. well it completes the upload, but it responds back:

avrdude: serial_baud_lookup(): unknown baud rate: 144000

Ok, now the real problem is that even though it said it completed the upload.. there is no change in the programming.. tested against the simple blink program.. no difference if I change the time high or low.

Weird, but this is progress! So, Coding Badly... where did you come across that bit of info?

The baud-rate generator is derived from the system clock, so if the CPU frequency is too high the baud rate will also be proportionally too high. Since avrdude apparently can't deal with intermediate baud rates, you'll need to recompile Optiboot for a 20MHz CPU clock frequency.

Good deal.. I found a forum post that explained some of this.. do you know where I can find any detailed information on how to recompile optiboot?

Actually it looks like more recent versions of avrdude can handle odd baud rates ok. Try using the v1.0r1 IDE.