Sei sulla pagina 1di 2

Birzeit University - Faculty of Information Technology

Computer Systems Engineering Department - ENCS432


Computer Organization and Microprocessor Interface - 1
st
semester - 2013/14
PICMicro assembly project #1
Using a 2 16 LCD with PIC16F877A
Due: February 6, 2014
Instructor: Dr. Hanna Bullata
2 16 LCD with PIC16F877A
You are required to build a system that uses a PIC16F877A and a 2 16 LCD display.
Two push buttons should also be connected to the system and will direct the display on
the LCD. Well call the rst push button P
1
and the second push button P
2
.
On power up, the rst row of the LCD should display BZU ID numbers of the project part-
ners (e.g., ID1, ID2) while the second row should display the rst names of the project
partners (e.g., fname1, fname2). If P
1
is clicked, the display on the rst row gets al-
ternated, meaning the display should show on the rst row ID2, ID1. In addition, the
display on the second row gets alternated as well, meaning the display should show on the
second row fname2, fname1.
If push button P
2
is clicked, the rst and second rows get alternated, meaning the rst row
should display fname1, fname2 (or fname2, fname if P
1
was clicked previously) while the
second row should display BZU ID numbers of the project partners ID1, ID2 (or ID2,
ID1 if P
1
was clicked previously).
Further clicking on push buttons P
1
and P
2
should alternate the above behavior.
Kindly note the following:
Operate the LCD in the 4-bit mode.
Use PORTB (RB4 - RB7) for LCD data pins DB4 - DB7. Ignore LCD data pins
DB0 - DB3 (these pins remain unconnected).
Use pin RB0 for the push button P
1
.
Use pin RB1 for the push button P
2
.
Use pin RB2 for the LCD Register Select pin (RS).
Use pin RB3 for the LCD Enable pin (E).
You are free to pick another pin conguration for the LCD if you need to.
Things to keep in mind
Remember that on power up, PORTA is congured as an analog input port. You
thus need to change PORTA to become digital instead of analog (check register
ADCON1 in the datasheet).
Remember to use the 4M oscillator that you connect to pins 13 & 14 of the micro-
controller. You also need to connect a 22pf capacitor to each of its pins.
Remember to attach pin 1 (MCLR) to 5V using a resistor of 4.7K (or a resistor of
10K).
Provide 5V to VDD (pin 11) and ground to VSS (pin 12).
Remember to give power to the LCD through its rst 2 pins.
Remember to pull down to ground pin 3 of the LCD (VEE) and pin 5 (R/W).
Remember to pull up the LCD RS pin to VDD using a 4.7K resistor.
Be gentle with the microcontroller. Avoid touching the pins.
Before powering up, make sure you didnt mix the VCC and GND pins (pins 11 &
12). Once you power the bread board, if you feel the PIC16F877A is getting very
hot, remove the power immediately. That might be a sign that the VCC and GND
are connected somehow by mistake.
Things to do
Use MPLAB to write your assembly code and assemble it using the mpasmwin
assembler.
Do a simulation for your program to make sure it behaves as expected.
Download the generated hex le to your microcontroller using a programmer device
and then build the complete circuit.
Make sure your circuit runs properly and respects the specications described above.

Potrebbero piacerti anche