Hey guys,
I am trying to interface a Microchip PIC18F45J10 to the Crystalfontz CFAH1604ANYGJP# (16x4) LCD. I am having difficulty with the initialization of the screen. When I power the screen on, I obviously get lines 1 and 3 as completely filled in dark (which I believe is normal) so I adjust the contrast POT so that I can just about see the dark lines (which I use to determine whether the screen is initialized or not). I am using the initialization codes from the datasheet for 4-bit mode, and the attachments are as follows (you can see them in the attached .c file as well):
Vss to GND
Vdd to +5V
VO to 10k-ohm POT
LCD DB7 to PIC RD7
LCD DB6 to PIC RD6
LCD DB5 to PIC RD5
LCD DB4 to PIC RD4
LCD EN to PIC RD3
LCD RS to PIC RD2
LCD RW to GND
I have tried everything from double checking time delays and init codes and adjusting the contrast while running to see if the screen has in fact been initialized. However, everytime I run the program, the LCD screen remains in its original state when powered on (lines 1 and 3 black). I think I'm missing something small but I cannot tell what it is. I am using Microchip MPLab C18 compiler to generate the hex file, which I then put onto the PIC18 using the PICkit 2 programmer (just in case someone needs to know that when looking at my c-code). Could someone please take a look at my attached .txt file which contains my c-code and see where I'm going wrong?
Thank you in advance!
I am trying to interface a Microchip PIC18F45J10 to the Crystalfontz CFAH1604ANYGJP# (16x4) LCD. I am having difficulty with the initialization of the screen. When I power the screen on, I obviously get lines 1 and 3 as completely filled in dark (which I believe is normal) so I adjust the contrast POT so that I can just about see the dark lines (which I use to determine whether the screen is initialized or not). I am using the initialization codes from the datasheet for 4-bit mode, and the attachments are as follows (you can see them in the attached .c file as well):
Vss to GND
Vdd to +5V
VO to 10k-ohm POT
LCD DB7 to PIC RD7
LCD DB6 to PIC RD6
LCD DB5 to PIC RD5
LCD DB4 to PIC RD4
LCD EN to PIC RD3
LCD RS to PIC RD2
LCD RW to GND
I have tried everything from double checking time delays and init codes and adjusting the contrast while running to see if the screen has in fact been initialized. However, everytime I run the program, the LCD screen remains in its original state when powered on (lines 1 and 3 black). I think I'm missing something small but I cannot tell what it is. I am using Microchip MPLab C18 compiler to generate the hex file, which I then put onto the PIC18 using the PICkit 2 programmer (just in case someone needs to know that when looking at my c-code). Could someone please take a look at my attached .txt file which contains my c-code and see where I'm going wrong?
Thank you in advance!
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
Attachments
-
3.1 KB Views: 235