Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 disabledStep 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