Is softserial can be apply to any digital gpio pins ?

Here is the thing ,

I assigned digital gpio pin9 and digital gpio pin10 for Softserial by declare

SoftwareSerial mySerial (9, 10); // define serial port pin (RX,TX)

The Tx (pin10) works perfect . However , Rx (pin9) can't read any thing .

I've tried to wired hardware serial and my software serial together and read data in serial event , which

void serialEvent() { while (mySerial.available()||Serial.available() ) {

if (mySerial.available()) { ...... } if (Serial.available()) { ...... } } }

which I expect both hardware serial and software serial will receive the same data . However , always hardware serial receive data but soft serial never receive a byte .

I've also tried to read by

void mySerialEvent() {

if (mySerial.available()) { ...... }


which I don't know whether I can simply doing this ?

Anyway , I just can't receive a byte from software serial in pin9 .

Any suggestions ?

Thanks in advance .

Best regards, Sidney

The documentation for Software Serial describes the limitations. It is kind of complex because it's different for each Arduino variant.

The Micro is very strange with only a couple of pins useable for receive. Most other Arduinos have fewer limitations.

Which Arduino are you using?

Software serial works with pin which support PCINT, check whether the Atmega you are using support PCINT on pin 9.