Hi All
I'm busy following a PDF "tutorial" on LCD displays, but am at a point where I can't seem to get the thing working. The PDF file is called lcd1.pdf and is found at http://cr4.globalspec.com/thread/13340/Driving-an-LCD-using-a-PIC-16F84A
Basically, I can clear the display and show a blinking cursor, but that's where it stops. Sending data through to the D0 to D7 pins to show a character "A" doesn't do a thing, even with the 'RS' pin set to high and after setting 'E' to 1 and back to 0.
I'm using a PIC16F627 with a display labelled "MC1602C-SYR". I have read on the forum that the recommended / suggested LCD display is a Hitachi HD44780A00, however the local supplier does not stock this, so I was forced to "improvise".
In addition, I'm using GCBasic to compile the HEX for the PIC.
Another side note: The datasheet for this LCD shows pinouts that match exactly to the ones in the PDF document referred to above.
I have a couple of my own suspicions as to why I can't get this to work:
1. In the PDF a reference is made to the pixel size of the display per character. While it only refers to 7 x 5 and 10 x 5, the LCD I have has 8 x 5 pixels. If I set the D2 bit of Function Set to 0, will it automatically use the 8 x 5 pixels? (Default)
2. When using GCBasic, if I set a pin to 1 and back to 0, is this like pressing a momentary switch? I believe that this is indeed the case, as the display passes through each "stage" successfully. IE: In my code, I wait 1000 ms before clearing the display, 1000 ms before showing the cursor, and then 1000 ms before enabling the second line of the LCD display. In each stage, you are required to "push" a switch connected to "E", and this seems to be happening successfully.
Just for some additional information, the pinouts of the components on the breadboard is below.
PIC:
Pin 4: 4.7k Resistor to Pin 14 (no reset switch)
Pin 5: Ground
Pin 6 - 13: D0 to D7 on the display (in numeric order so RB0 = D0, RB1 = D1, etc...)
Pin 14: +5V Supply
Pin 17: E pin on LCD display (Pin 6)
Pin 18: RS pin on LCD Display (Pin 4)
LCD: (Pins not specified above)
Pin 1: Ground
Pin 2: +5V Supply
Pin 3: (Vee / Contrast) 47K Resistor to Ground
Pin 5: (RW) Ground
Is there any apparent reason I can't seem to send data to the LCD in character mode? If neccessary, I can upload the BAS file for GCBasic as well as the ASM file generated when compiling...
Thanks!
EDIT: Additional Note: I'm using the internal 4MHz oscillator of the 627.
I'm busy following a PDF "tutorial" on LCD displays, but am at a point where I can't seem to get the thing working. The PDF file is called lcd1.pdf and is found at http://cr4.globalspec.com/thread/13340/Driving-an-LCD-using-a-PIC-16F84A
Basically, I can clear the display and show a blinking cursor, but that's where it stops. Sending data through to the D0 to D7 pins to show a character "A" doesn't do a thing, even with the 'RS' pin set to high and after setting 'E' to 1 and back to 0.
I'm using a PIC16F627 with a display labelled "MC1602C-SYR". I have read on the forum that the recommended / suggested LCD display is a Hitachi HD44780A00, however the local supplier does not stock this, so I was forced to "improvise".
Another side note: The datasheet for this LCD shows pinouts that match exactly to the ones in the PDF document referred to above.
I have a couple of my own suspicions as to why I can't get this to work:
1. In the PDF a reference is made to the pixel size of the display per character. While it only refers to 7 x 5 and 10 x 5, the LCD I have has 8 x 5 pixels. If I set the D2 bit of Function Set to 0, will it automatically use the 8 x 5 pixels? (Default)
2. When using GCBasic, if I set a pin to 1 and back to 0, is this like pressing a momentary switch? I believe that this is indeed the case, as the display passes through each "stage" successfully. IE: In my code, I wait 1000 ms before clearing the display, 1000 ms before showing the cursor, and then 1000 ms before enabling the second line of the LCD display. In each stage, you are required to "push" a switch connected to "E", and this seems to be happening successfully.
Just for some additional information, the pinouts of the components on the breadboard is below.
PIC:
Pin 4: 4.7k Resistor to Pin 14 (no reset switch)
Pin 5: Ground
Pin 6 - 13: D0 to D7 on the display (in numeric order so RB0 = D0, RB1 = D1, etc...)
Pin 14: +5V Supply
Pin 17: E pin on LCD display (Pin 6)
Pin 18: RS pin on LCD Display (Pin 4)
LCD: (Pins not specified above)
Pin 1: Ground
Pin 2: +5V Supply
Pin 3: (Vee / Contrast) 47K Resistor to Ground
Pin 5: (RW) Ground
Is there any apparent reason I can't seem to send data to the LCD in character mode? If neccessary, I can upload the BAS file for GCBasic as well as the ASM file generated when compiling...
Thanks!
EDIT: Additional Note: I'm using the internal 4MHz oscillator of the 627.