It is required that you create a subroutine whose input is


Your task is to write the code needed to implement a chasing light display. The display consists of a ring of eight LEDs with a segment of three lit LEDs circulating in iL Normally the segment circulates clockwise, but when a pushbutton is pressed the segment begins to circulate counterclockwise.

 

Figure I shows the circuitry with which your code must operate. Figure 2 shows the layout of the eight LEDs needed to create the display, along with a table indicating the diodes that must be lit to display each of the patterns in the sequence.

 

Your program should work as follows:

 

1. Upon power-up, the diodes should display the patterns in the sequence 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, ... at the rate of two patterns per second.

 

2. When the user pushes the switch. the diodes should complete the forward sequence ...5, 6, 7, 0 and then begin to display the patterns in the reverse sequence 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, ...

 

3. When the user releases the switch, the display should complete the reverse sequence ... 3, 2, I, 0 and then resume the forward sequence 1, 2, 3, 4, 5, 6, 7, 0, I, 2, 3, ....

 

You may make use of any of the code that was supplied to you or wrinen by you during this course. You may also make use of code that is found in the references mentioned on the cover sheet of this test. You may NOT use code from any other source.

 

It is required that you create a subroutine whose input is the pattern number to be displayed and whose output is the bit pattern needed to light the proper diodes. You will also find it necessary to create or modify a subroutine to give the necessary delay for a two-pattern-pa-second rate.

 

Submit your final program on a USB Flash Drive in a valid .asm file format, ready to be assembled by MPLAB. Along with the USB Flash Drive, submit a program listing in hardcopy as well as the cover sheet of this test with the pledge signed. Use sufficient comments in your code to make the functioning of your program easy to follow. Include your name in a comment at the beginning of the program.

 

It is permissible for you to try assembling, simulating, or implementing the file before the due date to verify proper operation of your code, but you must use your own resources to do so. Your program will be graded first by downloading it to a PIC and trying the PIC in the instructor's circuit. Programs that do not work in this manner will be given partial credit based on the number and types of errors found in the program listing. Credit will be deducted for code (even properly functioning code) that is cumbersome and lacking in elegance.

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: It is required that you create a subroutine whose input is
Reference No:- TGS0929674

Expected delivery within 24 Hours