A-Star 328PB Micro - 5V, 20MHz it does not work

use this card and when opening the serial monitor to see my program and monitor a few buttons, the probe program hangs with using the serial in another range not in 9600 but in 115200 and likewise, it will not function to attach the program but that program I have already checked it in arduino and everything is excellent, I do not know how to avoid these errors, I disconnect the serial to continue running the program, because it may be a serial error but it is not valid, please help

const int inputPin = 3;
 
int value = 0;
 
void setup() {
  Serial.begin(9600);
  pinMode(inputPin, INPUT);
}
 
void loop(){
  value = digitalRead(inputPin);  //lectura digital de pin
 
  //mandar mensaje a puerto serie en función del valor leido
  if (value == HIGH) {
      Serial.println("Encendido");
  }
  else {
      Serial.println("Apagado");
  }
  delay(100);
}

Hello.

It sounds like you are saying your code only works when you set the Arduino IDE’s Serial Monitor to 9600 baud, which is expected since your sketch is set to that same baud rate. Just to be clear, in order to see any useful data in the Serial Monitor, its baud rate needs to match the baud rate of the sketch you are running when communicating via TTL serial.

- Amanda