Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

By AVR Port A is used to control 8 LEDs each one indicates the presence of a corresponding message. Port B connects to 8 switches

By AVR image text in transcribed
Port A is used to control 8 LEDs each one indicates the presence of a corresponding message. Port B connects to 8 switches which are used to choose the message to hear. Port C connects to 8 other switches which are used to erase the corresponding messages. If a new message exists, the corresponding LED blinks at a frequency of 10 Hz and a corresponding bit in the unsigned 8 hits variable "status" is set to 1. If your grandmother pushes the corresponding switch to listen to the message, the LED stops blinking and is illuminated continuously afterwards till she pushes the other switch to erase the message. When there is no message, the LED is off and the corresponding bit in status is 0. The controller runs at a frequency of 4 MHz. All the switches are read by the microcontroller as 1 when they are pushed and as 0 when they are not pushed. Further, assume that, the LEDs are lit when the corresponding pin of Port A outputs 1 and are turned off when the pin outputs 0. (Check the course notes to see how switches and LEDs are connected.) Write the necessary C code to choose the crystal frequency and configure the three ports. Assume that the code uint8_t status; status = get_status (); allows you to get the status while the function set_status (unit 8_t number); allows you to set the status to any uint8_t value you give. Add to your previous code a piece of C code to make the LED blink if the corresponding bit in status is 1. Change your code to include a variable "heard" to have a bit set to one when the switch to listen to the corresponding message i pushed then cause the corresponding LED to stay on and stop blinking. All this action occurs if the corresponding bit of status is set, i.e. if there is originally a message. Update your code to turn the LED off and clear the corresponding bit of status when the switch to erase the message is pushed

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

To find integral of sin(logx) .

Answered: 1 week ago

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago