Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SECTION C - AVR PERIPHERAL SYSTEMS Please answer this section in a separate book that is titled Section C on the front cover. This

SECTION C - AVR PERIPHERAL SYSTEMS
Please answer this section in a separate book that is titled "Section C" on the front cover. This section is worth 40 marks. If a value for a particular parameter, e.g. prescaler, is not given, choose yours and indicate it. In all cases show your working.
QUESTION C1
[20]
For a clock frequency of 8MHz, you are required to write a program to simultaneously sound a buzzer and drive a motor continuously. The buzzer, connected to PORTB.1, should be driven by a 1KHz square wave generated by TMR1 overflow interrupt. The motor, connected to OCO pin, should be driven by a 2KHz square wave generated by TMRO in the CTC mode toggling the OCO pin. Use a prescaler setting of 64 for TMRO and no prescaler for Timer 1.
a) For driving the motor with TMRO in CTC mode and toggling the OCO pin. [10]
i.) Determine the time it will take to toggle the OCO pin.
ii.) Determine the value to be loaded in the OCRO and write assembler instructions to configure the register.
iii.) Determine the value to be loaded in the TCCRO and write assembler instructions to configure the register.
[4]
b) For driving the buzzer with TMR1 overflow interrupt.
[10]
i.) Determine the time it takes for the interrupt to occur.
[1]
ii.) Determine the value to be loaded in the TCNT1H and TCNT1L.
[3]
iii.) Determine the value to be loaded in the TCCR1A and TCCR1B.
[4]
iv.) Determine the value to be loaded in the TIMSK.
[2]
4
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_2

Step: 3

blur-text-image_3

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

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago