Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are asked to design a Traffic sign using a PIC16F877A, 3 LEDs, one Seven Segment Display and one Buzzer. The green LED must be
You are asked to design a Traffic sign using a PIC16F877A, 3 LEDs, one Seven Segment Display and one Buzzer. The green LED must be connected to PORTBO, the yellow LED must be connected to PORTB1, and the red LED must be connected to PORTB2. You must connect the buzzer to PORTB3. Finally, you have a cathode type Seven Segment Display that must be connected to the pins of PORTD. Here is how your traffic sign is supposed to work: (1) You start at the Green state, where the cars pass and the pedestrians stop. In this state, you stay for 9 seconds. Here, the green LED must be on, and the red and yellow LEDs must be off. Your Seven segment display must show the remaining time in seconds in this state. (2) After 9 seconds passes in Green State, you now move on to the Yellow State. In this state you stay for 3 seconds. Here, the yellow LED must be on, and the green and red LEDs must be off. Similar to the Green state, your seven-segment display must show the remaining time in the Yellow State. (3) After 3 seconds passes in the Yellow state, you now move on to the Red State, where the cars stop and the pedestrians cross the street. In this state you stay for 7 seconds. Here, the red LED must be on, and the green and yellow LEDs must be off. In this state your seven-segment display must show the remaining time. But additionally, you will also turn the buzzer on for 500ms of each second so that the disabled people will know that the red light is on for the cars and that they may now cross the street. Notice that the buzzer is on for 500ms and off for 500ms of each second. This continues for the entire duration of the 7 seconds you must spend in the red state. (4) You now go back to the Green state and repeat steps 1-3 given above. First, draw the circuit diagram of your design. Show your MCU and the peripheral devices, and how they are connected to PIC16F877A. You will write your code in C. You may assume the existence of a function named "Delay500ms()" that will make you wait for 500ms. You may also assume that you have a function named "GetCode(int val)" that will return you the bit sequence you must send to the seven-segment display to display a value between 0-9. You are asked to design a Traffic sign using a PIC16F877A, 3 LEDs, one Seven Segment Display and one Buzzer. The green LED must be connected to PORTBO, the yellow LED must be connected to PORTB1, and the red LED must be connected to PORTB2. You must connect the buzzer to PORTB3. Finally, you have a cathode type Seven Segment Display that must be connected to the pins of PORTD. Here is how your traffic sign is supposed to work: (1) You start at the Green state, where the cars pass and the pedestrians stop. In this state, you stay for 9 seconds. Here, the green LED must be on, and the red and yellow LEDs must be off. Your Seven segment display must show the remaining time in seconds in this state. (2) After 9 seconds passes in Green State, you now move on to the Yellow State. In this state you stay for 3 seconds. Here, the yellow LED must be on, and the green and red LEDs must be off. Similar to the Green state, your seven-segment display must show the remaining time in the Yellow State. (3) After 3 seconds passes in the Yellow state, you now move on to the Red State, where the cars stop and the pedestrians cross the street. In this state you stay for 7 seconds. Here, the red LED must be on, and the green and yellow LEDs must be off. In this state your seven-segment display must show the remaining time. But additionally, you will also turn the buzzer on for 500ms of each second so that the disabled people will know that the red light is on for the cars and that they may now cross the street. Notice that the buzzer is on for 500ms and off for 500ms of each second. This continues for the entire duration of the 7 seconds you must spend in the red state. (4) You now go back to the Green state and repeat steps 1-3 given above. First, draw the circuit diagram of your design. Show your MCU and the peripheral devices, and how they are connected to PIC16F877A. You will write your code in C. You may assume the existence of a function named "Delay500ms()" that will make you wait for 500ms. You may also assume that you have a function named "GetCode(int val)" that will return you the bit sequence you must send to the seven-segment display to display a value between 0-9
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started