Page 1 of 1
Trouble getting LCD to work on port A
Posted: Thu Sep 03, 2009 7:13 pm
by dpasternack
Hi,
I'm trying to hook up a 2 X 16 LCD with a samsung driver to a PIC 16F88 microcontroller. I'm trying to run in 4 bit mode as it seems that the Flowcode component macro dictates. The LCD can run in either 4 bit or 8 bit mode and is software selectable. How do I enter the command in flowcode to tell the LCD to operate in 4 bit mode? I understand that I have 6 bits available on port A for i/o. I'm using RA0 - RA3 for data and RA4 and RA5 for RS and enable.
Your help is appreciated.
Dave
Re: Trouble getting LCD to work on port A
Posted: Thu Sep 03, 2009 9:36 pm
by medelec35
RA5 of 16F88 is input to microcontroller only. All other non power supply pins or bidirectional, So you will need a different pin to RA5 so can drive LCD.
I believe flowcode only drives LCD in 4 bit mode. As long osc in flowcode is set to same speed as osc in your hardware, and config is correct,it should work ok.
Re: Trouble getting LCD to work on port A
Posted: Fri Sep 04, 2009 2:14 am
by dpasternack
Thanks Medelc. I'll change the pin and see how it goes.
Re: Trouble getting LCD to work on port A
Posted: Fri Sep 04, 2009 2:45 am
by medelec35
Your welcome
Also RA5 is /MCLR. So in the config settings set to RA5 and not MCLR. If left on /MCLR then RA5 must be tied to +5V
To check your hardware is running OK:
Before setting up LCD, it may be a good idea to set up a flashing LED at a rate of 1 second (or just set an o/p to toggle every second and measure o/p with meter). If LED is flashing for correct time period then proceed to your LCD control routine.
Correct timing of LCDs is very important.
Good luck.
Re: Trouble getting LCD to work on port A
Posted: Sat Sep 05, 2009 12:09 am
by medelec35
Just was wondering how you have got on with your LCD Display?
I used a cheap display form RS components, Stock Number 532-6436 for Β£5.70. Works a treat. There is a disadvantage with this display, since it is transflective, it requires small value resistor for back light display. I used a 180R, which supplies with 10mA (1/2 max current) required. It is a nice Blue background with white characters. Display worked 1st time, and on PIC internal osc, so minimal components required. Display like other displays required a pot for contrast adjustment, although this bit is left-out the data sheet. If anyone required help with this display then let me know.
dpasternack wrote:Hi,
I'm trying to run in 4 bit mode as it seems that the Flowcode component macro dictates. The LCD can run in either 4 bit or 8 bit mode and is software selectable. How do I enter the command in flowcode to tell the LCD to operate in 4 bit mode?
Your help is appreciated.Dave
I was correct, you do not need to enable 4 bit mode, flowcode does this automatically!
Re: Trouble getting LCD to work on port A
Posted: Mon Sep 07, 2009 2:31 pm
by dpasternack
Hi Medelec35,
With the 4 bits I need to drive the LCD plus the RS and Enable, I don't think I'm going to be able to use port A of the PIC16f88. RA5 can only be used as an input. So I'm left with only 5 I/O pins and I need 6. I can easily go to another PIC but I just thought I was missing something. Thanks for the help. It was valuable info. You can see I'm a beginner, but I learn a lot from these problems.