Tasks in embedded system

Thread Starter

Meti

Joined Sep 14, 2020
1
I need your help in solving this task in embedded system using atmega 328p in programming language c.

To implement the program which simulates the working principle of the traffic light for the passage of vehicles on the train tracks.
- Use LEDs instead of lights.
- To implement the possibility that enables the reduction of the time for execution of the traffic light
with minimal changes in the program for 10 times.

This is the specification of the traffic light work:
1.There are two modes of operation of the traffic light: "day" and "night".
- The "night" mode is activated by receiving the message via UART where the bit with index 0 and the bit with index 2 have the value 1.
- The mode "day" is activated by receiving the message via UART where the bit with index 0 and the bit with index 2 have the value 0.
- If a message is received that does not belong to any mode of operation ("day" or "night") then set an LED to the on state (LED connected to pin D7). Otherwise stop the LED on the D7.

2. In the "day" mode:
- The yellow light is off.
- Turn on the red light and turn off the green light for 1 minute.
- Turn on the green light and turn off the red light for 1 hour.


3. In the "night" mode:
- The red and green lights are off.
- The yellow light continuously stops for three seconds, then lights up for two seconds (blink).

Use Output Compare Interrupt to implement the program. Use UART with 19200 baud speed, 8 data bits, even parity, 1 start bit and 1 stop bit. Use of Arduino IDE functions is not permitted. Use pins C3, C4 and D5 as outputs for red, yellow and green light. Pin D7 to be used for the LED to signal the receipt of the wrong message.
The oscillator frequency is 4.6 Mhz. Implement a function for initialization of I / O, UART and Timer, as well as implemen
 

Irving

Joined Jan 30, 2016
2,067
Sounds like a fairly heavy coursework question...

What have you planned/decided so far? We can offer critique of what you plan but we won't do it for you. So outline your solution, show some psuedocode, flow chart, whatever, to demonstrate your understanding of the problem & solution...
 
Top