Go Down

Topic: Optiboot with FTDI breakout removed (Read 5043 times) previous topic - next topic


I have a Arduino type board that uses a FTDI breakout. The 328P has optiboot installed and the UNO is selected as the board type. I can compile sketches and download no problem. Once I have the sketch running on the board I can power off and on and the sketch runs. If I remove the FTDI breakout, the code will no longer start and run. If I plug the breakout board back on and it's powered the code runs. At that point I can remove the breakout and it will keep running. Obviously the optiboot does not like RX floating.

The Optiboot loader on reset or power on looks for serial data and after a timeout period, if it sees none, it should jump to the already loaded code.


I have not encountered this problem, although I've used Optiboot in many projects and I usually leave the RX/TX pins free to permit uploading new code.  Which version of Optiboot are you using?  Does this problem occur with the "blink" sketch?  Does it occur after a power-on reset?  Does it also occur after briefly grounding the reset pin?  Does it still occur if you ground Pin 0 before resetting?  After a reset does an LED on pin-13 blink 3-times?

A sharp photo of your setup would be helpful.


Can you provide a link to this Arduino-type board? Or if you built it, a schematic?


Reply to TIM7

I am using SoftwareSerial to connect to a serial LCD (PHA #117). RX=2, TX=3
1) Digital pins 0,1 free
2) Version of optiboot. Used ArduinoISP and set board to UNO on Arduino IDE 1.0 (Optiboot 4.4?)
3) Blink download works with FTDI breakout removed. Breakout is BUB2 from Modern Device.
4) Back to serial LCD. Fail after power on
5) Fail after reset
6) Fail with pin 0 grounded
7) On reset or power on,led on 13 blinks three times always

As to the board, it is my design for use with a solderless breadboard. It is identical to Arduino, but with a removable FTDI breakout.  It is similar to BBB from Modern Device. Nothing magic. I will upload images once I figure out how on this forum.


So does the Blink sketch run properly after reset with the FTDI removed?


One more note.

I switched to hardware serial. Connected serial LCD to pin 1. Failed in same way.


Blink works fine with FTDI removed. No problem.

I have another project using a LCD and DS1307. Code uses LiquidCrystal library, but no serial libraries. This works fine with FTDI removed.



The problem is fixed. Why it works I do not know. I decided that the serial code, whether hard or soft, must be interfering with the boot code. I added a half second delay right at the beginning of the code and now it works from reset or power on reset.

I do not know how Optiboot works; though, I do know how Tinyboot for the PIC works. After reset,the boot waits for serial download code for a second or so and if there is none it jumps to the code already in memory.


It does sound more like the hang is happening in your code, and not in Optiboot.  If you'd care to post it somebody might be able to find the reason.


I have a similar problem, but with a different board. [arduino mini 04 with atmega 328]. pls chk this post and let me know if someone has a solution. thank you.

http://arduino.cc/forum/index.php/topic,117632.0.html      [chk the last post]


Here is the code. It sends "Temperature"  and then "76.8" repeatedly to a serial LCD display. This code was simply to test the serial LCD (PH Anderson #117) which I found erratic. I am now using a design of my own using a PIC 18F886 which works.  As I said the initial delay(500) works.

#include <SoftwareSerial.h>
#define txPin 3
SoftwareSerial SLCD = SoftwareSerial(2,txPin); //
int bauderate=9600;

void setup() {
SLCD.print("?f"); //clear screen

void loop() {
SLCD.print("?x05"); //position cursor to x=4 y=0
SLCD.print("76.8"); //display temperature


I took your sketch, commented out the initial delay, and put it on a 16MHz Arduino Pro (essentially just an ATmega328 with a crystal and power supply).  With the FTDI interface connected or disconnected I couldn't get the sketch to fail -- it ran fine after a power-on reset or an external reset.  So I'm afraid I don't know what was causing the symptoms you describe.


What happens if you add a pullup (or pulldown) resistor to D0 ?

after a timeout period, if [optiboot] sees none, it should jump to the already loaded code.

That's how it's supposed to work.  That's how it DOES work, for the vast majority of cases.  Actually, on powerup it shouldn't even look for serial traffic ("adaboot fast start" hack.)  I am not able to come up with a hypothesis on why your board is behaving differently :-(


We'll leave it for now. I will shorten the delay and find minimum.

I worked on old mainframes and way back to 8085s and I have chased many, what we called, gremlins that made no sense. Maybe others will see a similar problem and in time it will make sense.

Thanks for taking a look at the problem.

I see that the Arduino Pro uses a resonator and mine a crystal. The frequency difference may make it work. I have several unpopulated pcbs so I may assemble one and use a resonator.

Go Up