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 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
 SECTION C - AVR PERIPHERAL SYSTEMS Please answer this section in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!