Lab 1: Implementing a Simple Counter Using the 8051
October 11, 2001
Name: Joe Schmoe
Login: schmoe
Contribution
My contribution to the lab: 50%
Description: I worked on wiring the circuit on the breadboard,
while my partner started working on the code. Once I was
finished, I helped my partner to complete the code.
My partner's contribution to the lab: 50%
Description: My partner worked on the C code for the counter
and looked over my circuit wiring to ensure I had wired it
correctly.
Summary
In this lab, we leared how to write a simple C program for the
80X51 micro-controller, compile it using C51 compiler, and emulate
it on an emulator using PDS51. The program we wrote was used to
control a simple 4-bit up-down counter, capable of counting from 0
to 15, which was displayed in decimal format on the LCD. The
counter works as follows:
Steps and Implementation
To implement the PrintInt() function we need to convert
the 4-bit counter value to a decimal string that can
then be displayed on the LCD. The following are the
operations that we performed for the conversion:
ch[0] = ...
ch[1] = ...
c51 count.c
c51 io.c
bl51 count.obj, io.obj to count.omf
Results
We successfully completed the lab such that our circuit functioned as it was supposed to. However, in the process of completing the lab, we ran into a problem when we forgot to connect the GND of the emulator's header. We also had some initial trouble in figuring out the code for PrintInt(). Once we fixed the software and hardware bugs our circuit worked correctly.
Code/Schematics
attach your code/schematics