Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
