In: Electrical Engineering
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.