Question: The buttons to increase and decrease the volume of an electronic musical instrument are connected to the external interrupt pins INTO and INT1 of an

The buttons to increase and decrease the volume of an electronic musical instrument are connected to the external interrupt pins INTO and INT1 of an Atmega32 microcontroller as depicted in Figure 1. A keyboard "event" corresponds to pressing or releasing a button. We want to program the microcontroller to record all the volume up/down events in an array of 1024 entries memory. Each entry should contain the number of the button pressed, the type of event (ie button pressed or released), and a timestamp. We assume that the global variable "uint16_t time" updated every millisecond by a Timer is available (the definition of the Timer configuration is not requested by this question). Assuming the necessary global variables, write the functions to realise a recording: (i) Write the function setup_volumel) that starts the recording by enabling interrupts on INTO and INT1, and initialising opportunely registers and variables. (ii) Write the interrupt service routine ISR(INTO_vect) and ISR(INT1_vect) that add an entry to the record in the array and disable the interrupts when the recording memory is full. The buttons to increase and decrease the volume of an electronic musical instrument are connected to the external interrupt pins INTO and INT1 of an Atmega32 microcontroller as depicted in Figure 1. A keyboard "event" corresponds to pressing or releasing a button. We want to program the microcontroller to record all the volume up/down events in an array of 1024 entries memory. Each entry should contain the number of the button pressed, the type of event (ie button pressed or released), and a timestamp. We assume that the global variable "uint16_t time" updated every millisecond by a Timer is available (the definition of the Timer configuration is not requested by this question). Assuming the necessary global variables, write the functions to realise a recording: (i) Write the function setup_volumel) that starts the recording by enabling interrupts on INTO and INT1, and initialising opportunely registers and variables. (ii) Write the interrupt service routine ISR(INTO_vect) and ISR(INT1_vect) that add an entry to the record in the array and disable the interrupts when the recording memory is full
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
