Arduino Zero Tx and Rx

Hi,

I was wondering if my pins D0(Rx) and D1(Tx) were working properly on Arduino Zero board. I directly wired them and uploaded this code to arduino:

void setup() {
  // put your setup code here, to run once:
  SerialUSB.begin(9600);
  while(!SerialUSB) { }
  Serial1.begin(9600);
}

void loop() {
  if (Serial1.available()) {
    SerialUSB.write(Serial1.read());
  }
  if (SerialUSB.available()) {
    Serial1.write(SerialUSB.read());
  }
}

After opening Serial Monitor and writing something I haven't received anything.

This is how wiring looks like:

As I understood Tx and Rx pins are working on UART TTL protocol on 3.3V(because it is Arduino Zero).

Is it possible to send and receive at the same time with Rx and Tx pins?

Does anyone know what I did wrong?

Thanks for help.

Good resource

Eh?

Code segment for an atmega32... not sure what you machine is..

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop() {
  // read from port 0, send to port 1:
  if (Serial.available()) {
    int inByte = Serial.read();
    Serial1.print(inByte, DEC);
  }
  // read from port 1, send to port 0:
  if (Serial1.available()) {
    int inByte = Serial1.read();
    Serial.print(inByte, DEC);
  }
}

Good luck

:smiley_cat:

Thank for the answer.

I just read this and don't think it is the same thing as I'm talking about.
As I understood Tx and Rx pins are working on UART TTL protocol. If I'm correct, these pins should recognize by themselves where are start and stop bits.

I'm trying to send and receive UART message through my pins. Actually to send message to myself printing it on serial monitor. As a step in my project where I want to check these pins.

Thanks for the code, unfortunately this is not working. Mine machine is Arduino Zero.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.