CMPE 453 Lab-1 to 7 solutions

$150.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

CMPE 453, Lab-1, Section-2 Binary Game of the Leds and 7-segment Display solution

1- Set up a circuit with breadboard, Arduino-Uno, 7-segment display, 220Ω resistors
(11), 3 LEDs and jumpers.

2- Program ATMEGA328p microcontroller by using C programming on
Arduino IDE. Provide the connection between your computer and Arduino
board.When your program runs, itshould repeat the following cycle:

For each cycle, send a random number between 7 and 0 to 7-segment display so that
it displays that number for 3 seconds. The number on 7-segment display will be
simultaneously played by the Leds as a binary light game.

For instance, if the
number on the display is:
4 Leds should be On-Off-Off
3 Leds should be Off-On-On
0 Leds should be Off-Off-Off

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

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)

CMPE 453, Section-2 Lab-3 BUTTON CONTROLLED I2C DATA TRANSFER

A- In this LAB, you will use
Arduino-Uno Arduino Base
Shield
Grove Button Grove LCD
Screen

I. Connect Arduino base shield to Arduino Uno.
II. Grove Button should be connected to any digital interface of base shield.
III. Grove LCD Screen communicates with Arduino via I2C.

Useful information:
https://wiki.seeedstudio.com/GroveLCD_RGB_Backlight/
https://wiki.seeedstudio.com/Grove-Button/

B- Program the microcontroller by using C programming on Arduino IDE.
When your program runs, it should do the following task.
I. At the beginning, “Hello” message should be displayed on LCD Screen.
II. Number of button presses should be displayed on LCD display. If
there exists 5 presses in 3 seconds, the number on LCD display should
be set to 0.

CMPE453 LAB: Basic Color Sensor using Atmega328p Analog to Digital Converter

In this lab, our goal is to design a basic color sensor which is able to distinguish between Red,
Yellow and Blue color objects.

Items Required:
1. Breadboard
2. Color LEDs (Red, Yellow and Blue) = 03
3. Groove Light Sensor
4. Connecting Wires

5. Arduino Uno Board
6. Groove Base Shield
7. Resistors = 220 ohm x3 (For LEDs).
8. Color Balls (or other similar objects)- Red, Blue and Yellow.

Operating Principal.
When a color object is irradiated by a color light containing Red Green Blue component, the
color intensity of reflected light will change depending upon the color of the object. For
example, if an object is Red colored, and it is illuminated by Red, Green and Blue color LEDs
then the intensity of reflected light in response to red LED will be greater as compared to the
intensity of reflected light in response to other LEDs as shown in following figure.

In this way we can design a basic color sensor which is able to sense the color of an object
placed in front of LEDs and whose reflected light falls on LDR.

Hardware Setup.
You are required to connect three LEDs (Red, Yellow and Blue) to the GPIO pins and Light
Sensor to Analog Input 0 (i.e. Pin PC0) of microcontroller. Important thing is how to place
Light Sensor and LEDs on the breadboard so that the light emitted by the LEDs falls on the
object only and not directly on the Light Sensor. To do so, we must isolate the Light Sensor
from LEDs by using a black tape. The following setup can be a good help.

Now, the object to be detected should be placed above the LEDs at a suitable distance, so that
the reflected light falls on Light Sensor. (Do the rest of the wiring yourself).

Software Setup
You need to open Serial.begin(9600) in the setup function.

In the main function you need to do the following:
1. Define output pins for LEDs
2. Declare variables of type uint16_t to store the intensity of reflected light for Red,
Yellow and Blue.

3. In the while Loop:
 Turn on Blue LED and wait 2 seconds.
 Read ADC and store it in the registry as blue.
 Turn on Yellow LED and wait 2 seconds.
 Read ADC and store it in the registry as yellow.
 Turn on Red in RGB LED and wait 2 seconds.
 Read ADC and store it in the registry as red.
 if intensity_red > intensity_yellow && intensity_red > intensity_blue Send
Message (“color is red”);
else if intensity_yellow > intensity_blue Send Message (“color is
yellow”);
else Send Message (“color is blue”);

CMPE453, Section-2 Lab-5 Interrupt Handling using Atmega328p Microcontroller

The purpose of thislab activity isto understand the mechanism of interrupt handling by the microcontroller.

Hardware Requirements
1) Arduino Uno Board
2) Breadboard
3) Push Button
4) LED with Resistor (suitable resistance rating)
5) Connecting wires

Hardware Setup
1) Assume you have 1 pushbutton (PB1).
2) Connect Push Button with the pin INT0 of microcontroller in such a way that pressing it
should generate voltage level “LOW” at the pin.
3) Now connect LED with other general purpose I/O Pins Of microcontroller.

Software Setup
In the software you are required to do the following.

1. Configure the pin INT0 as an input pin with Internal PULL UP resistor enabled.

2. Write the Interrupt Initialization Routine which performs the followings:
a. Enable the global interrupts (sei(); or set the I bit of SREG)
b. Enable INT0 interrupt (set the corresponding bits of EIMSK Register)
c. Set the corresponding bits of EICRA register to enable LOW Level Interrupt on INT0

3. In the while loop, write the code that Toggle the LEDs after every 3 seconds.

4. Write the ISR for Push Button such that when it is pressed, it should toggle LED 4 times at an
interval of 1 sec.

CMPE453 Section-2 Lab-6 ADJUSTABLE CLOCK DESIGN BY USING TIMERS

In this lab students will design a real clock by programming Timer1 of AVR Microcontroller.

Hardware Requirements
1) Arduino Uno Board
2) Arduino Base Shield
3) Breadboard
4) Push Button
5) LCD Display
6) 2 Leds with Resistors
7) Connecting wires

Software Setup
In the software you are required to do the following.
1. It should continue displaying the current time on LCD display in the form of HH:MM:SS.

2. You should also use a push button in order to change the hour and minute by sending the new
values by using UART communication.

3. AVR should listen to UART and get the hour and minute from the user input.

4. If there is 1 press on the button in 2 seconds, the value sent by the user should set the hour part on
the clock and LED1 should be on for 1 second. If there is 2 presses on the button in 2 seconds, the
value sent by the user should set the minute part on the clock and LED2 should be on for 1 second.

5. Hour values outside of [0,23] and minute values outside of [0,59] should be accepted as invalid,
and the user should be prompted to enter new values.

CMPE 451, Section-1 Lab-7 ARM7: GPIO and Led Blinking

Before starting to Lab
 https://developer.arm.com/documentation/101407/0539/CreatingApplications/Tips-and-Tricks/Use-MDK-Version-4-Projects (Go to this
link and download the Arm7,Arm9, Cortex-R)

 https://developer.arm.com/downloads/view/ACOMP5 (Go to this link
and download the Arm Compiler 5.06 update 7(build 960) Win32)

A- In this LAB, you will use
I. Keil µvision.
II. Proteus simulation software

B- Steps
I. Use LPC2148/ LPC2138 microcontroller and connect eight LEDs to P0.9– P0.16
usingProteus simulation software.

II. Program the microcontroller by using C programming on Keil µvision IDE. When
your program runs, it should display binary number 100-255 on the LEDs in
circularway. Use sufficient delay between two numbers so that the numbers are
clearly visible.