Answered step by step
Verified Expert Solution
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 marks. If a value for a particular parameter, eg prescaler, is not given, choose yours and indicate it In all cases show your working.
QUESTION C
For a clock frequency of you are required to write a program to simultaneously sound a buzzer and drive a motor continuously. The buzzer, connected to PORTB should be driven by a square wave generated by TMR overflow interrupt. The motor, connected to OCO pin, should be driven by a square wave generated by TMRO in the CTC mode toggling the OCO pin. Use a prescaler setting of for TMRO and no prescaler for Timer
a For driving the motor with TMRO in CTC mode and toggling the OCO pin.
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.
b For driving the buzzer with TMR overflow interrupt.
i Determine the time it takes for the interrupt to occur.
ii Determine the value to be loaded in the TCNTH and TCNTL
iii. Determine the value to be loaded in the TCCRA and TCCRB
iv Determine the value to be loaded in the TIMSK.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started