Go Down

Topic: USART does not transmit any longer after power off (Read 1 time) previous topic - next topic

hmiezin

I am new to the Arduino, just got an UNO. very easy to setup and I am trying my first sketches successfully, BUT....

...when I write a sketch that requires serial output, the sketch works very well after upload from the IDE or after reset.
Now, if I disconnect the UNO, then reconnect it (power off, then on) the sketch restarts (a led continues blinking for example) but no characters can be transmitted on the serial .

Other sketches behave the same way. Examples provided with the IDE have the same problem (Basics, AnalogReadSerials or DigitalReadSerials). You can try it quite easily.

Seems that something in the hardware is intialized by the IDE on the board, which is not initialized by the sketches. In the 8U2 maybe ?

I need that the Arduino works as soon as power is available, so this is not convenient for my app.

Do you have an idea how to fix it ?

Thanks in advance.

mellis

Is it an Arduino Uno SMD?  If so, it might have a problem with any program restarting when the board is unplugged and replugged.  The pin 13 LED will flash every few seconds (three times each, I think). 

Can you confirm that your program is really running after unplugging and replugging the board?  For example, have it blink an LED on a different pin. 

If it's not running your sketches at all, you should return the board to your distributor for a replacement, as there was a problem in the version of the bootloader that was on the initial Uno SMD boards.

If it is running your sketches, but not transmitting serial, can you provide more information about how you're trying to read the serial port?  Do you close whatever terminal / monitor before unplugging and reopen it after replugging?  Does the pin 13 LED flash when you reopen the serial connection?

hmiezin

Hello,

I have an arduino UNO DIP, not SMD.
Difficult to imagine that my UNO has a failure, because everything else works well (communication with the PC, auto-reset, downloading new sketches etc.)

The sketch I use generates:
- an asymmetric blink (100ms / 1000ms)
- and the transmission of a string on the serial link ("on" / "off" strings).
I copied it below.

I check serial transmission with the serial monitor or a specific test program under processing.I always found identical results with both methods.

When uploaded and started by the ARDUINO IDE, it works as expected (asymmetrical blink and serial strings are received)
Then, if I reset with the button of the UNO, both blinking and serial reception still work.
Then if I unplug, then replug the USB, the asymmetrical blink works, but nothing is transmitted on the serial.
(note: power is provided throuth the usb)

If I use the "AnalogReadSerial.pde" which is provided as example with the ARDUINO IDE instead of my own sketch, the result is exactly the same.

I really beleive that my sketch forgets a HW initialization on the UNO, which is made by default by the IDE when it uploads the sketch.
But I do not have a little idea of details of what I forget !!
Do you have any idea ?

Here is my (quite simple) sketch:

void setup() {
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop() {

  Serial.println("on");
  digitalWrite(13, HIGH);
  delay(100);

Serial.println("off");
  digitalWrite(13, LOW);
  delay(1000);
 
}

Thanks in adavance for your support !!

Henri

mellis

What operating system?  What are you using to read the serial data?

Golbez

I'm having the same problem, did you end up fixing it?

My sketch definitely runs after putting the power on, as it displays info to a LCD over a softwareserial. The default USART serial doesn't work though.

The Pin13 LED flashes 3 times, and TX/RX never light up, and nothing ever gets sent.

Since the sketch runs, it's unlikely to be the Uno SMD bootloader problem, is it?

Go Up