Go Down

Topic: Let us Learn UART Port based Serial Data Communication by Solving Questions (Read 667 times) previous topic - next topic

GolamMostafa

The following diagram depicts the conceptual view of Serial Data Communication between UNO and NANO using Hardware UART Port (UART Port) and Software UART Port (SUART Port).


Please download the attached pdf file for questions along with selective answers. Criticisms and comments are welcomed.

Exercise-1 for the readers:  Write program to achieve the following objectives.
Enter 12x56y in the InputBox of Serial Monitor-1 using Keyboard of the PC, click on the Send Button of Serial Monitor-1; check that --
12
56
have appeared on the OutputBox of Serial Monitor-2.
Solution: (... in progress)
//Codes for UNO -- the Sender:
Code: [Select]
#include<SoftwareSerial.h>  //this file is needed to create Software UART Port (UART Port)
SoftwareSerial SUART(2, 3);  //SRX-pin = DPin-2 (Digital Pin-2 of UNO), STX-pin = DPin-3;

void setup()
{
    Serial.begin(9600); //UART Port is enabled at Bd = 9600
    SUART.begin(9600): //SUART Port is enabled at speed 9600
}

void loop()
{

}

Exercise-2 for the readers:  Write program to achieve the following objectives.
(1)  Use DVM (Digital Volt Meter) to measure DC voltages at A0-pin and A1-pin at the UNO (sender) side and record it as 2.35 and 4.15 (for example). These values will appear on Serial Monitor-2 in the following format:
Voltage received from A0-pin of UNO: xx.xx V       Voltage received from A1-pin of UNO: xx.xx V  

(2)  Slowly vary the Pots (R1 and R2) at the UNO side; check that the readings of Serial Monitor-2 changes accordingly.

Edit:  In view of Post#1.

J-M-L

#onclude<SoftwareSerial.h>  //this file is needed to create Software UART Port (UART Port)
SofywareSerial SUART(2, 3);  //SRX-pin = DPin-2 (Digital Pin-2 of UNO), STX-pin = DPin-3;
didn't you test if it would even compile ?
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

GolamMostafa

I acknowledge with great honor your spirit for right education and learning. Your meticulous observations are helpful to remain alert for the future. I am correcting the typo mistakes of the referred post.

Go Up