Trouble getting LCD to work on port A

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
dpasternack
Posts: 5
Joined: Tue Aug 04, 2009 1:47 pm

Trouble getting LCD to work on port A

Post 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

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Trouble getting LCD to work on port A

Post 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.
Last edited by medelec35 on Fri Sep 04, 2009 2:46 am, edited 1 time in total.
Martin

dpasternack
Posts: 5
Joined: Tue Aug 04, 2009 1:47 pm

Re: Trouble getting LCD to work on port A

Post by dpasternack »

Thanks Medelc. I'll change the pin and see how it goes.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Trouble getting LCD to work on port A

Post 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.
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Trouble getting LCD to work on port A

Post 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!
Martin

dpasternack
Posts: 5
Joined: Tue Aug 04, 2009 1:47 pm

Re: Trouble getting LCD to work on port A

Post 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.

Post Reply