Write code needed to implement a chasing light display

Assignment Help Electrical Engineering
Reference no: EM13676095

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.

Reference no: EM13676095

Questions Cloud

What was required to implement an organization''s commitment : What was required to implement an organization's commitment to social responsibility? What are the main obstacles to implementing socially responsible policies? Name specific actions that can be taken toward increased social responsibility.
Magnitude of electric field at the position indicated by dot : Three point charges are placed as shown in the figure (Figure 1) . The positive point charge has a value 6.5nC. What is the net electric field at the position of the dot?
Find the maximum vertical diving acceleration of submarine : A submarine with a total volume of 68.6 m3 has an inner chamber capable of taking in 16.1m3 of water (without changing the submarine's total volume). determine the maximum vertical diving acceleration of the submarine
Two cars are side-by-side on the highway : Two cars are (momentarily) side-by-side on the highway, moving in the same direction. Car A is moving with an initial speed of 20.0 m/s, accelerating at a rate of 5.0 m/s/s. At the time of alignment, Car B is travelling at 60 m/s and is slowing at a ..
Write code needed to implement a chasing light display : 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.
Determine what is the instantaneous power : Determine what is the instantaneous power, at a time of 0.00550 seconds, dissipated by a 200 Ω resistor in a resonant AC circuit powered by a generator
Small object begins a free-fall from a height : A small object begins a free-fall from a height of H = 82.5 m at t0 = 0 s. After? = 2.60 s, a second small object is launched vertically up from the ground with the initial velocity v0 = 40.2 m/s. At what height from the ground will the two objects f..
Determine what is the maximum positive emf : The emf of an AC circuit has an rms value of 120 Volt. Determine what is the maximum positive emf
Streetcars initial speed at the start of the crossing : A moving, and accelerating, streetcar travels 20.0 m during a street crossing in 2.40 s. It continues to accelerate after this crossing until it reaches a speed of 32.0 m/s.

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Design an 8051 microprocessor system that has total space

The EPROM should be mapped in a single block starting at address 0000 hex and the RAM should be mapped in a single block starting at address 8000 hex. 8051: Hardvard architecture with separate control busses for code and data memory.

  Draw the shift register circuit that would perform the task

A CRC is constructed to generate a 4-bit FCS for an 11-bit message.The generator polynomial is X4 + X3 + 1.a. Draw the shift register circuit that would perform this task.

  Calculate the voltage drop across the bulb

An electrical energy source forces a constant current of 500(mA) through a light bulb for one hour. If 12.6(kJ) is given off in the form of light and heat energy, calculate the voltage drop across the bulb.Use Engineering Notation with 3 decimal p..

  Develop an expression for the number of white atoms

A volume is divided into two equal parts by a partition. The left volume has N atoms. The atoms have a mass m. A hole of area A is made in the partition at time t=0 A)Develop an expression for the number of white atoms on each side of the partition..

  Explain moore sequential circuit

Moore sequential circuit, A Moore sequential circuit has one input and one output.The output goes to 1 when the input sequence 111 has occurred and the output goes to 0 if the input sequence

  Design a cascade of two lowpass l-networks to mathc

Design a cascade of two lowpass L-networks to optimally mathc Rs=50 ohm to RL = 5k ohms at 10MHz frequency. Choose network parameters to maximize overall bandwidth.

  What is the actual power being dissipated by the circuit

A 20V voltmeter with a sensitivity of 10,000 ohms / volt rating and a 5A ammeter are used to measure the power being dissipated in a dc circuit. The voltmeter reads 13V and the ammeter 2.1A.

  How to copy 3rd variable from 10-byte array into accumulator

Write the 9S12DP256 assembly language instructions below a programmer could use to copy the 3rd variable from a 10-byte array into Accumulator B.

  Illustrate per-phase analysis of power transmission system

The source has an abc-phase sequence. At the wye-connected load, the phase-a voltage Va'n' has phase angle (theta)a'n' = 60 degrees and the phase impedance is (10 + j15) ohms. Further, the line impedance per phase is (1.1+ j1.5) ohms

  What is the response of this system to the input x

A linear time-invariant system has a transfer function with a direct-current gain equal to 2 and a phase angle of 45°. What is the response of this system to the input x(t) = 4 cos(2t)

  What are the phasor angles of on simple rc series circuit

On a simple RC series circuit, with three voltages, Vin, Vc, Vr.Where Vin = Vc + Vr. With C = 0.047microfarads, Vin = 5

  Determine which lead is the gate and which lead is the body

Draw up a flow chart for testing any four-terminal MOSFET with an ohmmeter which can be used to conclusively determine which lead is the gate, which lead is the body, whether the device is an n-channel or p-channel, and whether the device is a D-m..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd