Help needed for diagnose/debug arduino+UART

Hi everyone,

I'm still new in RF projects so if there's anything that I did wrong, please point it out. This project is taken a toll on me so any suggestion to get it work is appreciated.

In this project, 2 pair of arduino uno + UART transceiver will be used. One pair will be transmitter and another will be receiver.

UART manual: https://docs.google.com/document/d/1M81Aai7GPp8EyYVdR6Og7xk3IiBtluJWwd8d_KPwu1E/edit

The code is located in https://pastebin.com/ctaVEmGK I will be using software serial since I kept getting stk500_getsync() error when hardware serial (pin 0 & 1) is being used. If possible, I would like to use hardware serial to reduce possible errors introduced in this project. Inside the code, byte code of 1 will be sent to receiver, if byte code of 1 is received, led will light up.

Picture of breadboard configuration for transmitter is located in https://imgur.com/a/wAprm Additonal information about the wiring, based on the UART manual, RX pin of UART will be connected to software TX of arduino, and vice versa. For receiver, the difference is that led is added to pin 6, if byte code of 1 is received, led will light up.

The received output via variable rx_byte is 255, even with RX and TX plugged out, it still outputs 255. The whole project hasn't been working once.

If there is any information needed for diagnosis, please ask.

Thank you in advance.

You need to post the programs you are using.

Also post some samples of the output produced by the programs,

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

I am using Arduino 1.8.3 32bit on a windows 10 machine

// transmitter (hardware serial)
char transmittedChar = '1';

void setup() 
{
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
}

void loop() 
{
    transmitOneChar();
}

void transmitOneChar() 
{
    Serial.write(transmittedChar);
}
// receiver (hardware serial)

char receivedChar;
boolean newData = false;

void setup() 
{
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
}

void loop() 
{
    recvOneChar();
    showNewData();
}

void recvOneChar() 
{
    if (Serial.available() > 0) 
    {
        receivedChar = Serial.read();
        newData = true;
    }
}

void showNewData() 
{
    if (newData == true) 
    {
        Serial.println(receivedChar);
        newData = false;
    }
}

Transmitter code:

11111111111111111111111111111111…//keeps on going

Receiver code:

On transmitter UART, TX led on arduino lights up, on receiver UART, RX led doesn’t light up. Hope this is enough information.

In your transmit code add delay(1000); into loop() to slow things down. An Arduino works very much faster than any serial communication.

In your Original Post you said you are using SoftwareSerial but neither of your programs uses it. Trying to use HardwareSErial for debugging and for transmitting is just going to cause confusion.

I don't have time now to study the Wireless device manual - I will bookmark this for later.

...R