CMPE 453, Lab-2, Section-2 UART Communication between Host PC and Atmega328p microcontroller on ArduinoUno Board

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (1 vote)

In this lab your task is to establish serial communication between host computer and
Atmega328p microcontroller present on Arduino Uno Board. You are required to develop an
embedded system which could accept a character between 0 and 9 from the serial monitor of
host PC and display this on the seven segment display.

Following is the exact sequence of operation to be implemented.
1) Configure both serial monitor of host computer and Atmega328 controller with
following UART settings
a. Baud Rate 9600
b. Normal asynchronous mode
c. 8 data bits per UART frame
d. 1 start , 1 stop and 1 parity bit.

2) After the UART initialization routine in your code. The microcontroller should send a
prompt message “Connected: Please send a number between 0 and 9”.

3) Then the microcontroller should wait for a character to be received from serial port.

4) If a character is received, your code should verify if it is a valid character (integerbetween
0 and 9). You can verify this by comparing the value received with ASCII representation of
numbers between 0 and 9.

5) If it is a valid character (integer between 0 and 9), the number should be displayed to
the seven segment display connected to any digital I/0 port of Atmega328p. At the same
time,the microcontrollershould transmit a message “You entered succesfully” to the host
computer.

6) If the character received is invalid (i.e. outside the range of 0 to 9) then the
microcontroller should transmit a message “Invalid Character: send again” and again wait
for character to be received from host computer.

7) When you enter 3, your 7-segment display show 3,2,1,0 with delay(1000).

Hardware Required:
1) Arduino Uno Board with USB type cable.
2) Bread board.
3) Seven segment display
4) 220 ohm – 330 ohm resistors (8 – 10)
5) Connecting wires (male to male: as per need)