Pages: [1]   Go Down
Author Topic: tx pin active while loading program  (Read 540 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

When I load my program into the arduino by:

1. ) pressing reset on aurdino ng
2.) pressing "upload to i/o board" in software

the tx pin seems to echo out what is coming in over usb.

Is it possible to stop this? I have the tx pin connected to external components and they do
not like the random data sent to them.

Currently I have to unplug the tx pin while uploading a new program.

Any ideas or advice?

Thanks.
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the tx pin seems to echo out what is coming in over usb.
The data sent over USB "goes into" the TX/RX pins of the device.

--Phil.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
the tx pin seems to echo out what is coming in over usb.
The data sent over USB "goes into" the TX/RX pins of the device.

--Phil.

Understood - sorta smiley

I thought that the usb data would be coming in the rx.

It seems like it is getting echo'd out the tx.

Thanks for the reply, btw.

Logged

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I thought that the usb data would be coming in the rx.
 
It seems like it is getting echo'd out the tx
The bootloader checks the data before writing it to memory.  The pattern you see is a long burst from the computer, followed by a short blip back to the computer.  This is a chunk of the program uploading to the arduino followed by the bootloader saying "that chunk was OK".

Sorry, but that's just the way the bootloader works.  You're stuck with disconnecting your other device, unless you want to buy a programmer and download the program via ICSP, or come up with some sort of circuit that electrically disconnects or powers down your peripheral while booting.

-j

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A way to solve this is to use a relay or a pin in the arduino(assuming low-ish power device) to turn on or off the serial component.
Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Currently I have to unplug the tx pin while uploading a new program.

It may not be clear to everyone, but you don't need the Tx pin connected in order to download a sketch. Even though it seems to ACK back to the IDE, all that is needed is Rx (+Vcc & Gnd).

It sounds like you already know this, but unfortunately the "ACK" can't be turned off. So it looks like your best bet is to somehow automate disconnecting the Tx to your device. Does your device need the Rx to send data back to the Arduino?

If not, the trick would be to know when your loading a sketch and use a relay or something as was suggested. Sounds like a lot of work. It all depends on how big a problem it is.
John
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It may not be clear to everyone, but you don't need the Tx pin connected in order to download a sketch. Even though it seems to ACK back to the IDE, all that is needed is Rx (+Vcc & Gnd).
Really? I thought that avrdude used two-way communication (using something like the STK500 protocol) to upload the code.

--Phil.
Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It may not be clear to everyone, but you don't need the Tx pin connected in order to download a sketch. Even though it seems to ACK back to the IDE, all that is needed is Rx (+Vcc & Gnd).

Really? I thought that avrdude used two-way communication (using something like the STK500 protocol) to upload the code.
I'm sorry! I was probably wrong . And I said it with such certainty too!  :smiley
(Before I posted, I even checked some projects I made and still screwed up!) My rule here was not to post unless I knew what I was talking about, but **it happens, I guess.

Follower, thanks for catching that.
John
« Last Edit: September 16, 2008, 09:57:33 am by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Portland, OR
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Skip the bootloader, burn the sketch directly!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you're going to be reprogramming your device with any sort of regularity, I'd say throw an optoisolator, or other sort of relay, on the tx line between the arduino and your serial device, and have that controlled by some other pin.

If you're only reprogamming it until you've got it debugged (and you're not programming it while it's in some sort of enclosure) best thing to do is just disconnect the tx line before reprogramming. It's a pain, but you're stuck with it. ...unless you move from arduino to sanguino, or you want to move your device over to a software serial connection.
Logged

Pages: [1]   Go Up
Jump to: