Question: we use atmelstudio , atmega 1 2 8 and proteus. I need help for my project. Task 1 : Write the following code in main.c

we use atmelstudio , atmega128 and proteus. I need help for my project.
Task 1: Write the following code in main.c file.
```
* Author : hafiz22e
*/
```
```
#define F_CPU 16000000L
#include
#include
int main(void)
{
DDRB =0b00000001;
while (1)
{
PORTB =0b00000001;
_delay_ms(500);
PORTB =0b00000000;
_delay_ms(500);
}
}
```
code in report where your code each lines include comments and results discussions as well at the end of each
task.
Use the figure 1 to design the circuit on proteus and connect the wire accordingly.
You can use any port to design the circuit.
Irrelevent discussion of results marked as zero.
Task 1: Use the lab 3 task 1 code and build a following circuit given in figure on proteus. After
completing the task, run the code and show it to instructor.
Double click on the controller and select the correct parameter fig 2 b (blue) for the setting.
Do analysis on parameter that you select & why you choose? Mentioned in report.
Edit Component
Part Reference:
Part Value:
Element
PCB Package:
Program File:
CKOPT (Oscillator Options)
BOOTRST (Select Reset Vector)
WDTON (Watchdog timer always on)
CKSEL Fuses:
Boot Loader Size:
SUT Fuses:
Advanced Properties:
Clock Frequency
Task 2: Build a following circuit given in figure 3 on proteus, write a code to toggle the state of the LED
when button is pressed.
Figure 3
Task 3: Using Atmega 128 Connect 8 LEDs to any port and toggle the pins of the port indefinitely.
Figure 4
Task 4: Wave Generation
Generate the square waves of 25%,50% and 75% duty cycle using delay function for different
frequencies in C language.
Make a circuit design on proteus and verify your code.
o Hint: You can use the leds for shows the frequencies and the better understanding as well.
Figure 5
Task 5: Traffic Signal controller
You need to design a four-way traffic signal controller. Your code and design must be in a well
manner way to indicates each parameter. Fig2.
Make a flow chart.
Code
Circuit Diagram on Proteus.
we use atmelstudio , atmega 1 2 8 and proteus. I

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!