Question: Using HCS12, write a C program 5) 7 marks] A push button is connected to IRQ pin to trigger interrupts. When the button is pressed,

Using HCS12, write a C program

Using HCS12, write a C program 5) 7 marks] A push button

5) 7 marks] A push button is connected to IRQ pin to trigger interrupts. When the button is pressed, one seven-segment display counts for 10 second before a device is activated. The display should count from 9 to 0 and then the device is activated by outputting 1 to pin 1 of port T. when the count reaches 0, it should display zero and when the button is pressed it counts again from 9 to 0. If the switch is pressed before the counting reaches 0, the counting should be paused. When pressed again, the counting is resumed. Write a C program. A hint: using RTI may make the solution easy When IRQ is interrupted: (1) if the count = 0, enable RTI interrupt to count from 9 to 0 and when the count = 0 RTI interrupt should disable itself. (2) if the count is not 0 (the counting is running), then toggle the status of RTI interrupt: disable it if it is enabled or enable it if it is disabled. 5) 7 marks] A push button is connected to IRQ pin to trigger interrupts. When the button is pressed, one seven-segment display counts for 10 second before a device is activated. The display should count from 9 to 0 and then the device is activated by outputting 1 to pin 1 of port T. when the count reaches 0, it should display zero and when the button is pressed it counts again from 9 to 0. If the switch is pressed before the counting reaches 0, the counting should be paused. When pressed again, the counting is resumed. Write a C program. A hint: using RTI may make the solution easy When IRQ is interrupted: (1) if the count = 0, enable RTI interrupt to count from 9 to 0 and when the count = 0 RTI interrupt should disable itself. (2) if the count is not 0 (the counting is running), then toggle the status of RTI interrupt: disable it if it is enabled or enable it if it is disabled

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!