Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to create two counters BIG_Counter & Small Counter with initial values of 255 and 1 respectively. The program's flow will be controlled from

image text in transcribed
You are to create two counters BIG_Counter & Small Counter with initial values of 255 and 1 respectively. The program's flow will be controlled from a toggle switch in the CADET which will be connected to pin RE2 on the PIC board. Each time the toggle switch is set the following should happen: The numbers are added and the result displayed on the CADET LEDs The value of the carry bit is displayed by one of the PIC board LEDs A delay of about 10 seconds is created so we can see the LED states properly BIG_COUNTER decrements by one until it reaches zero then resets to initial value (ie. 255 -> 254 -> 253....-> 1 -> 0 -> 255 ->...) SMALL_COUNTER moves to the next power of 2 until it overflows then resets to initial value, (i.e., 1 -> 2 -> 4 -> 8 -> 16 -> 32 -> 64 -> 128 -> 1 ->...) As long;: as the toggle switch is set the above keeps repeating. It halts only when the toggle switch is brought back to zero and continues where it left off when toggle is set again. NOTE 1 you should write your program using as many subroutines as possible so that ii has a good structure. Choose the proper pins for output according to your discretion and based on w hat we learned so far. Including the project#1 lab. Suggested output pins: B0,.B5 and C0, Cl (Note: make sure these ports are not bad. If any of the selected ports are bad as you identified in Project 2, try to use other ports, and modify the program in You are to create two counters BIG_Counter & Small Counter with initial values of 255 and 1 respectively. The program's flow will be controlled from a toggle switch in the CADET which will be connected to pin RE2 on the PIC board. Each time the toggle switch is set the following should happen: The numbers are added and the result displayed on the CADET LEDs The value of the carry bit is displayed by one of the PIC board LEDs A delay of about 10 seconds is created so we can see the LED states properly BIG_COUNTER decrements by one until it reaches zero then resets to initial value (ie. 255 -> 254 -> 253....-> 1 -> 0 -> 255 ->...) SMALL_COUNTER moves to the next power of 2 until it overflows then resets to initial value, (i.e., 1 -> 2 -> 4 -> 8 -> 16 -> 32 -> 64 -> 128 -> 1 ->...) As long;: as the toggle switch is set the above keeps repeating. It halts only when the toggle switch is brought back to zero and continues where it left off when toggle is set again. NOTE 1 you should write your program using as many subroutines as possible so that ii has a good structure. Choose the proper pins for output according to your discretion and based on w hat we learned so far. Including the project#1 lab. Suggested output pins: B0,.B5 and C0, Cl (Note: make sure these ports are not bad. If any of the selected ports are bad as you identified in Project 2, try to use other ports, and modify the program in

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions