Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[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

image text in transcribed
[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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning PostgreSQL On The Cloud Simplifying Database As A Service On Cloud Platforms

Authors: Baji Shaik ,Avinash Vallarapu

1st Edition

1484234464, 978-1484234464

More Books

Students also viewed these Databases questions

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago