Pages: [1] 2   Go Down
Author Topic: Optiboot with FTDI breakout removed  (Read 1690 times)
0 Members and 1 Guest are viewing this topic.
Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3968
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One more note.

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

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Schematic


* uLab28AVR Rev B_C.png (17.44 KB, 1051x816 - viewed 32 times.)
Logged

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 134
We were born naked, wet and hungry. And then things get worse!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
 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]
Logged

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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() {
delay(500);
pinMode(txPin,OUTPUT);
SLCD.begin(bauderate);
SLCD.print("?f"); //clear screen
SLCD.print("Temperature");
}

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

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 124
Posts: 6652
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
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 :-(
Logged

Tallahassee, FL USA
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Jump to: