Sei sulla pagina 1di 2

Institute of Arts, Science and Technology

_________________________________________________________________

Assignment No.2
Display A/D Conversion Result on 3 Digit 7 Segment Display

This assignment is to be implemented on the PIC Microtrainers in the Micros


Laboratory. Patch wires are to be connected from the sockets of PORTD to the
inputs of the 3 Digit 7 Segment Display LED’s such that Bit 0 connects to
segment a, Bit 1connects to segment b and so on. Another patch wire is to be
connected from the output of the potentiometer (labelled POT 0-5 Volt) to the
PORTA bit 0 socket. The 3 LED displays will be controlled by connecting
patch wires from PORTE Bits 2, 1, 0 to Digits 1, 2 and 3 repsectively.
Write a program which will read an analogue voltage from the potentiometer,
convert it into an 8-bit binary number and produce a display on the LED’s such
that the 7 segment display will display a number in denary (base 10) between
000 and 255 to represent a voltage between 0 and 5 Volts. The program should
cycle round continually updating the display.
Note that the above brief is the minimum requirement for this assignment and
will only attract 85% of the total mark.
In order to qualify for the remaining 15% of the total, the program will also be
able to display the A/D result in Octal (base 8) when a switch connected to bit
0 of Port B is high (logic 1).

1. Using MPLAB, develop and debug a program to carry out this task on a
16F877A PIC processor. Once it is working in the simulator, burn the program
into the Microcontroller and try running it in the PIC Trainer.

2. The code required to use the 7 Segment Display on the 16F877A and
possible algorithms to develop the rest of the code will be worked through in
class tutorials. It is not possible in MPLAB to simulate A/D conversion so you
will have to test your code on a dummy value placed in the appropriate register.

3. You should submit a report describing how the program operates, you
should include a flow chart along with the descriptive material. A listing of the
assembler code should also be included which must contain explanatory
comments. As well as testing your programme in the microtrainer, for which
your tutor will award additional marks you must also show evidence of
simulation using appropriate test data. Acceptable evidence will comprise
screenshots of MPLAB windows along with explanations. The report should
also contain an evaluation and conclusion. Consideration will also be given to
report presentation. Marks will be awarded based on the Marking scheme.

Microelectronic Systems – Main Assignment (continued)

Marking: This assignment comprises 60% of the overall unit assessment.


_______________________________________________________________

Electrical Engineering Division - 2010

BENG2 Microprocessor systems


Institute of Arts, Science and Technology
_________________________________________________________________

Deadline: 19th January 2010

Marking Scheme (Basic)

Name: Total:

Specification: 5%

Analysis: (Outputs, Inputs, Processing) 15%

Program Design (Structure / Flow Charts / Pseudo Code) 15%

Test Data: 10%

Program Coding: 15%

Testing/ Debugging / Rectification: 15%

Evaluation (Review of program / Successes & Failures /


Future work / Industrial applicability): 10%

Total 85%

Marking Scheme (Complete)

Display A/D value in Octal 15%

Total 100%

_______________________________________________________________

Electrical Engineering Division - 2010

BENG2 Microprocessor systems

Potrebbero piacerti anche