Arduino Micro USB TX Problem

Hello,

I am using a Arduino Mikro and flash it with the arduino IDE.

I wrote a simple program, that writes everything out what it gets to and over the usb connection.

The thing is, that it only works if i am using the Arduino IDE Service Monitor. Then, i can see, that if i write data to the com-device, i receive also data. Also the TX and RX led are lighting up.

It doesn't work with other tools or programs like hterm. I can send data, also data will received, but the arduino itsself doesn't send any data through the usb device, so the TX led is never going on.

Maybe I have to tell the arduino over a start byte, that i am connected it with?
Can you please help me or tell me, what i am doing wrong?

I set the Baud, data etc. correctly (as I think):
Baud: 9600
Data: 8
Stop: 1
Parity: None

I also used other configs without sucess.

I had the same problem but with the uno, just make sure all your connections are right because if you plugged something that doesn't receive or transmits in pin 1 and 2 then just unplug them and upload an empty sketch. Only pin 1 and 2 are for special components that only receives and transmits,

If the program works with the Arduino Serial Monitor it should work with any terminal program. I presume you are connecting with a USB cable? If so, pins 0 and 1 are irrelevant.

The Micro is a small version of the Leonardo and the process of resetting it is different from an Uno or Mega. When you press Reset it drops the USB serial connection and then re-enables it. This may cause confusion for the terminal program.

Post the code you are using.

...R

I hope, the code helps you:

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {

  Serial.begin(9600);  
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  
  byte b = 0;
  
  if(Serial.available()>0) {
    b = Serial.read();
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(100);  
   Serial.print(b);  

  }
}

Yes, i am connected with an usb cable.
This program works with the Serial Monitor of the Arduino IDE, but not with my terminal programs hterm.

UPDATE:
As you mentioned, that the Arduino is a Leonardo, I found this

and updated my code:

int led = 13;

// the setup routine runs once when you press reset:
void setup() {

  Serial.begin(9600);  
  // while the serial stream is not open, do nothing:
   while (!Serial) ;
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  
  byte b = 0;
  
  if(Serial.available()>0) {
    b = Serial.read();
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(100);  
   Serial.print(b);  

  }
}

Now, hterm also doesn't work, because it seams to block at while(!Serial);
With the Serial Monitor, it leave the while clause and starts the main program.

KMW_USER:
I hope, the code helps you:

That code works fine on my Leonardo with the Serial Monitor and with puTTY.

The Serial Monitor only sends the character if I press return. But (because I have not bothered to change the settings) my puTTY sends the character as soon as the key is pressed.

...R

PS, I am using Linux on my PC.

The Leonardo and Micro need to have DTREnable set, when the serial port is opened. The Serial Monitor application does this. You need to make sure that your program sets DTREnable to true, too.