Question
6. Write a complete C program to do the following: 1. Setup TimerA_0 in UP mode to generate a periodic interrupt every 125 ms. 2.
6. Write a complete C program to do the following:
1. Setup TimerA_0 in UP mode to generate a periodic interrupt every 125 ms.
2. In the TA0 interrupt service routine (ISR), control P1.0 (LED connected) to toggle it at a rate of about 4 Hz.
3. Assume a pushbutton switch is connected to P1.1 with appropriate debounce circuitry (activating the switch will force the pin low). Setup the input pin with the pullup enabled, and write an ISR for Port 1 to implement the following behavior: each press of the switch should change the frequency that P2.2 is toggled. Alternate between 1 Hz and 0.5 Hz. Do not change the TimerA_0 setup to change the frequency of P2.2.
Be sure to compile it in CCS to catch any syntax errors. Show your work (e.g., calculations of timer parameters).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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