Question

In: Electrical Engineering

1. An LED is connected to PORTB.5 of ATmega328 microcontroller. Write a C Program that toggles...

1. An LED is connected to PORTB.5 of ATmega328 microcontroller.
Write a C Program that toggles LED after 0.5 Seconds. Assume XTAL = 16MHz.
To generate this delay use Timer 1 CTC (Clear Timer on Compare match) mode
Programming.

2. Write a program to generate a square wave of frequency of 250 Hz with 50% duty
cycle on PORTB.5. Assume XTAL = 16MHz.
Use Timer 2 Normal Mode Programming.

3. Write a program using 16-bit timer to generate a square wave of frequency 100Hz
with 70% duty cycle. Assume the crystal frequency is 16 MHz.

Solutions

Expert Solution


Related Solutions

An LED is connected to PD3 and a Button is connected to PD0. Write a C...
An LED is connected to PD3 and a Button is connected to PD0. Write a C program that will wait for the button to be pressed and then released (make sure you debounce the press and release). Each time the button is pressed, the LED blinks a number of times corresponding to how many times the button has been pressed and released. For example, when the button is pressed and released for the first time, the LED will blink once;...
Q1- Write code in C language(Atmel atmega32 avr microcontroller) (a)-Switches are connected to Port C and...
Q1- Write code in C language(Atmel atmega32 avr microcontroller) (a)-Switches are connected to Port C and Port B and LED’s with PORTD. Write a code to read input from PortB and C and perform following. Addition of both inputs, Subtraction, Multiplication, Division, And, Or, Nor,Xor. (b)- A switch is connected to PD0 and LED’s to Port B and Port C. Write a code to perform following: When switch is 0 send your roll number to Port B. When Switch is...
Write the following in C language for Arduino: Write a program that turns on the LED...
Write the following in C language for Arduino: Write a program that turns on the LED at 25%, 50%, 75%, 100%, and then 0% brightness with a one second delay in between each change. Remember you are going to need to use a PWM pin and use the "analogWrite" command. The maximum value for our Arduino R3 boards is 255 and you need five steps (25%, 50%, 75%, 100%, and 0%) so you will need to determine the values for...
Write the following in C language for Arduino: Write a program that increases the LED brightness...
Write the following in C language for Arduino: Write a program that increases the LED brightness in five steps with each press of the button. Remember you are going to using a digital input and the "digitalRead" command. You are going to need to use a PWM pin and use the "analogWrite" command. The maximum value for our Arduino R3 boards is 255 and you need five steps (25%, 50%, 75%, 100%, and 0%) so you will need to determine...
Write a C program for a PIC18F4321 microcontroller to convert eight LM-34 temperature sensors, which are...
Write a C program for a PIC18F4321 microcontroller to convert eight LM-34 temperature sensors, which are connecte4d to AN0 to AN7, and display on a display consisting of two 7-segment displays. Use a three-bit switch to select one of the eight sensors to display.
Write a program in C (NOT C++ or C#) The program inputs 5 elements into each...
Write a program in C (NOT C++ or C#) The program inputs 5 elements into each of 2 integer arrays. Multiply corresponding array elements, that is, arrayOne[0] * arrayTwo[0], etc. Save the product into a third array called prodArray[ ]. Display the product array.
Produce program code to facilitate LED and switch interface with a microcontroller-based development board (Arduino). Explain...
Produce program code to facilitate LED and switch interface with a microcontroller-based development board (Arduino). Explain the programming process and interface circuits required
Write a C program that evaluates the factorials from 1 to 5. Print results in a...
Write a C program that evaluates the factorials from 1 to 5. Print results in a tabular format.
write a program for the microcontroller-msp430fr6989 using code composer studio not assembly language. write a code...
write a program for the microcontroller-msp430fr6989 using code composer studio not assembly language. write a code that transmits a single character and lights the red LED upon receiving that character. The board will "talk" to itself. The green LED should turn on whenever a message is sent and the LCD will display the message being received.
Write an assembly language program for 8051 microcontroller to find the sum of the following series,...
Write an assembly language program for 8051 microcontroller to find the sum of the following series, 1, -2, +3, -4, +5, -6,..., up to 100 terms. Store lower byte in R0 and higher byte in R1.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT