I need help (receive HEX from PC to arduino)

Hardware : arduino micro

Hardware circuit:

Code:

#include<SoftwareSerial.h>
SoftwareSerial mySerial(11,12); //RX .TX
byte transitValue = 0x00;

void setup() {
Serial.begin(9600);
mySerial.begin(9600);

}

void loop() {
if(mySerial.available())
{
transitValue =mySerial.read();
}
Serial.println((byte)transitValue,HEX);
Serial.println((byte)transitValue,BIN);
delay(1000);

}

Question is I send (HEX)1B from PC serial tool , the arduino receive (HEX)72 ?
I try serial1 to receive HEX from PC, the result is the same. send (HEX)1B, arduino receive (HEX)72.

Can't see your schematic, and you're lacking detail in your description, but I'm going to guess you're missing an inversion.

q164129345:
Hardware : arduino micro

Why don't you use Serial1 (pins 0 and 1) ?

If you send data from the PC it comes via Serial,
you are reading and printing SoftwareSerial.

What is attached to pins 11 and 12?

AWOL:
Can't see your schematic, and you're lacking detail in your description, but I'm going to guess you're missing an inversion.

please check the attached.

Whandall:
Why don't you use Serial1 (pins 0 and 1) ?

If you send data from the PC it comes via Serial,
you are reading and printing SoftwareSerial.

What is attached to pins 11 and 12?

SoftwareSerial.h can make normak digital pin become serial port.

I tried serial1 and the result is the same. >_<

q164129345:
I tried serial1 and the result is the same. >_<

And what makes you hope that SoftwareSerial works better than HardwareSerial?

The number of connections on your claimed USB-TTL converter makes me believe it's a USB to RS-232 Adapter,
hopefully using TTL-Level (RS-232 has -12V for HIGH and +12V for LOW).

Whandall:
And what makes you hope that SoftwareSerial works better than HardwareSerial?

The number of connections on your claimed USB-TTL converter makes me believe it's a USB to RS-232 Adapter,
hopefully using TTL-Level (RS-232 has -12V for HIGH and +12V for LOW).

Dear Whandall:

I saw a lot of engineer use SoftwareSerial to communication successful. However, I tried SoftwareSerial and HardwareSerial , the result is the same.

it's USB to (RS232)UART converter. Are you questioning my hardware? it mean my code is no problem??

Whandall:
And what makes you hope that SoftwareSerial works better than HardwareSerial?

The number of connections on your claimed USB-TTL converter makes me believe it's a USB to RS-232 Adapter,
hopefully using TTL-Level (RS-232 has -12V for HIGH and +12V for LOW).

Dear Whandall:

Thank you for your help. Thank you so much.

I think I found the problem. You are right. My problem is I don't understand the difference between RS-232(RX,TX) and TTL(RX,TX). I need to study ,haha..

This morning, I tried to use another IC(CAN transform TTL) to test the code and circuit again . It's work. arduino micro got (HEX)1B.