Task 1: Manual Control of Duqum Railway Gate Figure 1 depicts a gate controller for Duqum railway. In the figure, cars are allowed to cross the railway as long as the gate is NOT lowered, where the green light is lit for as long as it is safe for cars to cross. However, when a train approaches, the gate will be lowered and cars will not be allowed to cross until the train has passed the gate. There are two modes to control the gate: manual (using a switch) and automatic (periodic). The following tasks give more details about each mode. For the manual control of the gate, assume the following: The gate is controlled with a switch (Manual Switch). When Manual Switch is OFF (i.e. input = 0), then the green light will remain ON (i.e. output = 1) and cars are allowed to pass. ● When the Manual Switch is ON (i.e. input = 1), then there is a train approaching. When this happens, the green light is turned OFF (i.e. output = 0) and the red light will start to blink rapidly at a frequency of 4 Hz (make sure that the red light blinks TWO times per second). The red light will keep blinking until the Manual Switch is back to OFF. This is where the green light will be lit again and the red light will be OFF.

Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
icon
Related questions
Question
Lab 1: AVR Microcontroller’s Assembler and GPIO
Lab Objectives:
Learn how to use AVR assembler and Simulator
Developing software that accesses GPIO pins of the AVR microcontroller.
Learn how to use soft delays in applications.
I.
Pre-Lab:
You are requested to complete this pre-lab before coming to the lab session. Lab instructors will
check and evaluate your work at the beginning of the lab session.
Warning: do not copy solutions from previous semesters, labs are updated every semester!
Before you begin:
> Create a folder for each part. Save all work on your flash disk. Folders can be named:
lab1_task1, lab1_task2, etc.
Task 1: Manual Control of Duqum Railway Gate
Figure 1 depicts a gate controller for Duqum railway. In the figure, cars are allowed to cross the
railway as long as the gate is NOT lowered, where the green light is lit for as long as it is safe for
cars to cross. However, when a train approaches, the gate will be lowered and cars will not be
allowed to cross until the train has passed the gate. There are two modes to control the gate: manual
(using a switch) and automatic (periodic). The following tasks give more details about each mode.
For the manual control of the gate, assume the following:
The gate is controlled with a switch (Manual Switch).
When Manual Switch is OFF (i.e. input = 0), then the green light will remain ON (i.e.
output = 1) and cars are allowed to pass.
When the Manual Switch is ON (i.e. input = 1), then there is a train approaching. When
this happens, the green light is turned OFF (i.e. output = 0) and the red light will start to
blink rapidly at a frequency of 4 Hz, (make sure that the red light blinks TWO times per
second).
The red light will keep blinking until the Manual Switch is back to OFF. This is where the
green light will be lit again and the red light will be OFF.
The library util/delay.h implements the delay function _delay_ms (). This function can
cause a delay in milliseconds. For example, to introduce a 20ms delay, the function is called as
follows:_delay ms (20);However, this function cannot intduce delays longer than 50 ms. As
a work around, the following custom function is created for you in order to introduce delays of
virtually any duration.
1 of 4
ECCE4227: Embedded Systems
FALL 2021
This function can be called from the main subroutine whenever needed! For example, to introduce
a delay of 2 seconds, the function can be called as follows my_delay(2000);
void my_delay(int ms)
{
int i;
for (i = 0; i < ms; i++)
_delay_ms (1) ;
}
Manual Switch
Transcribed Image Text:Lab 1: AVR Microcontroller’s Assembler and GPIO Lab Objectives: Learn how to use AVR assembler and Simulator Developing software that accesses GPIO pins of the AVR microcontroller. Learn how to use soft delays in applications. I. Pre-Lab: You are requested to complete this pre-lab before coming to the lab session. Lab instructors will check and evaluate your work at the beginning of the lab session. Warning: do not copy solutions from previous semesters, labs are updated every semester! Before you begin: > Create a folder for each part. Save all work on your flash disk. Folders can be named: lab1_task1, lab1_task2, etc. Task 1: Manual Control of Duqum Railway Gate Figure 1 depicts a gate controller for Duqum railway. In the figure, cars are allowed to cross the railway as long as the gate is NOT lowered, where the green light is lit for as long as it is safe for cars to cross. However, when a train approaches, the gate will be lowered and cars will not be allowed to cross until the train has passed the gate. There are two modes to control the gate: manual (using a switch) and automatic (periodic). The following tasks give more details about each mode. For the manual control of the gate, assume the following: The gate is controlled with a switch (Manual Switch). When Manual Switch is OFF (i.e. input = 0), then the green light will remain ON (i.e. output = 1) and cars are allowed to pass. When the Manual Switch is ON (i.e. input = 1), then there is a train approaching. When this happens, the green light is turned OFF (i.e. output = 0) and the red light will start to blink rapidly at a frequency of 4 Hz, (make sure that the red light blinks TWO times per second). The red light will keep blinking until the Manual Switch is back to OFF. This is where the green light will be lit again and the red light will be OFF. The library util/delay.h implements the delay function _delay_ms (). This function can cause a delay in milliseconds. For example, to introduce a 20ms delay, the function is called as follows:_delay ms (20);However, this function cannot intduce delays longer than 50 ms. As a work around, the following custom function is created for you in order to introduce delays of virtually any duration. 1 of 4 ECCE4227: Embedded Systems FALL 2021 This function can be called from the main subroutine whenever needed! For example, to introduce a delay of 2 seconds, the function can be called as follows my_delay(2000); void my_delay(int ms) { int i; for (i = 0; i < ms; i++) _delay_ms (1) ; } Manual Switch
Manual Switch
Figure 1: Railway Gate
Develop a C program that captures the requirements above. Use Proteus Platform to verify
and validate the program that you developed. Figure 2 illustrates how to add a switch called
LogicState from Proteus library. Figure 3 shows how to add a traffic light from Proteus
library: you have to connect the yellow LED to the ground to operate the traffic light model!
2 of 4
ECCE4227: Embedded Systems
FALL 2021
Figure2: Adding a switch from Proteus library.
AS.3 AXAR AK
Figure 3: Adding a traffic light from Proteus library.
Transcribed Image Text:Manual Switch Figure 1: Railway Gate Develop a C program that captures the requirements above. Use Proteus Platform to verify and validate the program that you developed. Figure 2 illustrates how to add a switch called LogicState from Proteus library. Figure 3 shows how to add a traffic light from Proteus library: you have to connect the yellow LED to the ground to operate the traffic light model! 2 of 4 ECCE4227: Embedded Systems FALL 2021 Figure2: Adding a switch from Proteus library. AS.3 AXAR AK Figure 3: Adding a traffic light from Proteus library.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Pressure sensors
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education
Fundamentals of Electric Circuits
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education
Electric Circuits. (11th Edition)
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON
Engineering Electromagnetics
Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,