Question: [7 marks] Write a small main.c file for an MCU operating at 4 MHz that uses TIMERO configured to count button presses as an external
[7 marks] Write a small main.c file for an MCU operating at 4 MHz that uses TIMERO configured to count button presses as an external input. You have an LED and resistor between pin 21 and ground. There is no LCD attached. The program should count rising edges from the button pin. At every tenth rising edge, turn on the LED until the next button press. (10 marks] We want to create non-blocking delays using the Timero module for the amount of time shown in the table below. Assume the end of the delay is triggered by the flag TMROIF. Give the maximum operating frequency fosc, the start value of WriteTimer0(value) and prescaler N. Also give the difference, At, between the time you actually get and the desired time. The prescaler should be chosen to give the smallest At. Show your work. Max fosc Start value Time (s) 1.7623 0.2350 11.178 7.5201 3.963 [7 marks] Write a small main.c file for an MCU operating at 4 MHz that uses TIMERO configured to count button presses as an external input. You have an LED and resistor between pin 21 and ground. There is no LCD attached. The program should count rising edges from the button pin. At every tenth rising edge, turn on the LED until the next button press. (10 marks] We want to create non-blocking delays using the Timero module for the amount of time shown in the table below. Assume the end of the delay is triggered by the flag TMROIF. Give the maximum operating frequency fosc, the start value of WriteTimer0(value) and prescaler N. Also give the difference, At, between the time you actually get and the desired time. The prescaler should be chosen to give the smallest At. Show your work. Max fosc Start value Time (s) 1.7623 0.2350 11.178 7.5201 3.963
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
