8051-Moving Display
This 8051 project shows a moving display. To simulate circuit in this project,
initially activate Mixed Mode simulator from the Schematic Editor window.
Simulation can be performed by selecting Run Transient analysis (Oscillograph)
from Simulation menu.
The circuit contains an 8051 chip, Buffer register, Binary to 7 Segment Decoder
and 7-Segment LED Display. In this circuit, Port P0 of 8051 is set as the output
port.
An internal counter is set to count from 0 to ‘FF’. This sequence that appears at
Port P0 is transferred through each of the 3 buffer registers in accordance with
the timing that is set for each of the registers. The counting sequence appears
in
7-segment form
in a moving fashion
The source code written either in C or Assembly language can be viewed from the
code editor window
The program is as shown:
#include <8051.h>
void main ()
{
int i; // Variable is declared
for (i=0;i<256;i++) // A loop is given to count from 0 to 255
{
P0 = i; // The value in variable i is copied to P0.
}
}
The source code in the
code editor window
has to be
compiled
after making any modifications
(editing).
Also the code can be
debugged
during
simulation.