Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 : 5 MARKS missing registers in Hex format and use masking operators if required. #define F _ CPU 8 0 0 0 0

Question 5:
5 MARKS
missing registers in Hex format and use masking operators if required.
#define F_CPU 8000000 UL
int main ()
1
unsigned char x :
unsigned char result :
ADMUX
ADCSRA =
I/(1) choose channel 2, left adjust, ref=AREF
while (1){
//(2) enable ADC, divide clock by 64
ADCSRA =
;/l (3) make it start conversion.
do {
x= ADCSRA &
} while )=(0;
result =
I/(4) detecl the end of conversion
} ;/I (5) take only the most significant 8 bits of the result
1? and discard the least significant two bits. You may choose ADLAR value accordingly
// the rest of the code is ommitted.
Question 6:
9 MARKS
You are required to design an LED brightness controller using Timer 0 on Atmega 8 microcontroller. The program should generate a PWM signal to control the brightness of an LED (connected to PB3). You may follow the instructions given in the code below to complete the program.
For configuration of Ports and registers, you are required to use masking and shifting operators. [8 Marks]
#include avr/io.h> #include 1MHz
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

=+ Is the information up to date?

Answered: 1 week ago