Hello guys!
I have a little problem that I cannot understand.
I use Arduino Micro board, where I would like to utilize the second UART port. In my first attempt I hooked up USB-Serial cnverter to my PC and connected it's ground to board's ground and D-SUB 9 PIN 2 (RX) to TX pin on board.
Then I deployed following code:
void setup(){
Serial.begin(9600);
Serial.flush();
Serial1.begin(9600);
while (!Serial1) { }
Serial1.flush();
}
void loop(){
delay(1000);
Serial1.write(0x35);
Serial1.flush();
Serial.write(0x35);
Serial.flush();
}
I hoped it will write 0x35 binary data representing ASCII character 5 through bots serial connections (USB - Serial, and UART - Serial1). However, when I set up an launched serial monitor the one connected to Serial showed expected recieved value 0x35 (ASCII '5'), but the when I hooked up port connected to Serial1 I got 0x65 0x00 ('e' and white character). I tried that for few different bytes to send, and always got "weird" results on Serial1.
I have checked baudrates and other settings; I have also used different USB-Serial interfaces.
Could you help me to spot where the problem lays?