Connecting a alphanumeric LCD to Flowcode

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Flowcode controls alphanumeric LCDs by sending the data in 4 bit chunks instead of all 8 bits. It has been designed like this in an effort to save 4 I/O bits for other functions. So if you are designing hardware then you should connect your LCD as follows.

1 - Ground
2 - +5V
3 - Contrast pin (Centre tap from variable resistor with ends connected to +5V and Ground)
4 - Flowcode specified RS bit
5 - Ground (R/W pin set to Write mode)
6 - Flowcode specified E bit
7 - Not Connected
8 - Not Connected
9 - Not Connected
10 - Not Connected
11 - Flowcode specified D0 bit
12 - Flowcode specified D1 bit
13 - Flowcode specified D2 bit
14 - Flowcode specified D3 bit

You will have to connect all of the Flowcode specified bits onto the same microcontroller port to allow the device to work.

GJB
Posts: 11
Joined: Tue Jan 09, 2007 9:37 pm
Contact:

Crystal Frequency and displays

Post by GJB »

Hi ben
very timely posting.

I have a display driven from Port D of 877a. As we have many 16Mhz xtals in stock, I thought I would use those, and set the osc frequency in flow code to either 10 or 20 Mhz, but the display only displays corrupted characters, with any setting.

If I put a 4mhz xtal in, and select 4Mhz on flow code, then the display is ok.. If I put 20Mhz xtal and set 20Mhz, the display shows nothing.

I would have thought the display just received clocked data, and would be independant of clock speed?

Is there a fudge which will allow us to use up the 16Mhz xtals?
best regards Joe

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello Joe

The LCD displays are quite time critical as certain pulses (Enable pulse) have to last certin periods of time. The clock setting in Flowcode is a editable text box. You should be able to type in 16000000 to get the 16MHz to match your crystal. This should allow the LCD to work correctly.

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Gnu »

Do the pins 7-10 need to be grounded or is it OK to leave them floating?

Gnu

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello Gnu

Its best to leave pins 7-10 floating and unconnected.

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

Hi
I am using a PIC16F877A and on port D I am connecting the alphanumeric 20*4 LCD. The crystal is of 16MHz. But, the program works but nothing id displayed on the LCD. Does flowcode support connecting LCD's on Port D as by default it is connected to Port B. And does it support the HD44780 LCD Display?

Thanks
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello

Yes the display should be working. Are your LCD component connections set to use portD. To do this click on the small drop down on the component and then click on component connections. Also check that the clock speed setting in Flowcode is correct for your crystal and make sure that the hardware is set to use the XTAL oscillator.

Best way to troubleshoot an LCD. Power up the LCD and the top line of characters will show semi dark squares. Once the LCD start macro has run correctly these squares will dissapear and you will be able to use the display. If your squares do not go away then check the contrast, the supply to the LCD and the pin connections.

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

HI
I tried what you told but the lcd remained the same. There are 2 rows that are with some shadow. But nothing is happening on the LCD. I put a flashing LED on port A, to see if the PIC is working and the LED is Flashing as I set it. But the LCD is not working.

To make a silly question:
Does flowcode support all types of alphanumeric 20*4 LCD's??

Thanks
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello

If both rows of the LCD have shadow at power up then your contrast is set too low and could be casing the display problems. Are you sure that the clock speed in Flowcode is set to 16000000 and that the LCD is connected appropriatley for your Flowcode LCD component connections. Also are you running the chip in XTAL mode (HS in expert config screen).

Yes the 20 x 4 displays should work fine with Flowcode, a while ago we got as many types of Alphanumeric LCD as we could and got them all working with Flowcode.

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Gnu »

Good morning Benj.

Whilst on the subject of LCD displays, I note that you have tried many types. Have you found any which are push-fits into a rectangular hole and perhaps with multipin plug/sockets for the electrical connections ? I need to make a neat-looking job in a plastic box.

Regards, Gnu.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Good morning.

I think that most of the LCDs are very similar in style and packaging and should all fit nicely into a rectangular hole. You can always attach flying leads or solder on your own header to attach the display to your circuitry.

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

Hi
regarding my question, I used another LCD but with the same result. I did a simple program a flashing led and the lcd to display a word. The led is flashing but the lcd does nothing.
Thanks
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Are you sure that the clock speed in Flowcode is set to 16000000 and that the LCD is connected appropriatley for your Flowcode LCD component connections. Also are you running the chip in XTAL mode (HS in expert config screen).
Also are you running the LCD start macro at the beginning of your program?

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

Yes, the LCD start is the first thing in the program and the program clk is set to 16000000 [16MHz].

What can I do?????

Thanks
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello,

Please can you email me your Flowcode file and i will take a look for you. My email address is ben@matrixmultimedia.co.uk.

Also please could you state which version of Flowcode you are using. This can be found by going to Help -> About in Flowcode.

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

I sent you the file.

The program intention is only to work the LCD. then after it I will use it for my project. as I am testing bits and pieces of the final program then I compile it all together.

I am using the Flowcode v3.2.2 (the last update).

thanks
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello

Your program was configured to use the RC oscillator. This means that the clock speed is not fixed and your program will not run at the correct speed.

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

Hi,

I set it to XTAL but nothing happened. It is working as it was working, i.e. the LCD not functioning.
I am using a serial PIC programmer, and I set it the oscillator to HS, the write protect off, the low voltage programming on and the brown out reset on. Could it be because of one of these?
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello

Yes it was working but in RC mode so the clock speed was not fixed so the LCD would not function. Enabling the XTAL mode (HS in advanced settings) will allow you to use a accurate crystal to drive the clock of your PICmicro. As you are using your own hardware you will have to compare the hardware to the oscillator schematic given in the PICmicro datasheet. We provide a switch on our hardware that switches between the RC and XTAL modes.

So to round up. Both the software configuration and the hardware have to be configured for the XTAL mode to allow your PICmicro to run.

arnaud
Posts: 5
Joined: Wed Dec 05, 2007 10:59 pm
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by arnaud »

Hello,
I try to use a alphanumeric LCD. It works on simulation and on the V3 card development but nothing at all on my card. I verified connections, it's good.
I use the internal clock on the pic 16F628A. I don't understand what it happens.

Please , help me....

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

Hi Ben,

Regarding your last reply.
Yes, I am setting both the software and the hardware to XTAL (HS) mode. But still the LCD is not working.

WHAT CAN I DO? try another type of LCD?!

thanks
tomcat14

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

Hello Kirstom

Is your LED still flashing while in XTAL mode?

Arnaud - Have you set the clock in Flowcode to be the same speed as your internal clock onboard the chip.

arnaud
Posts: 5
Joined: Wed Dec 05, 2007 10:59 pm
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by arnaud »

Ok, i would like to try but I don't find the clock's value on the datasheet (16F628A). If you know that, give me it, please;

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by Benj »

See page 97 of the datasheet in the special features of the CPU section. Its a 4MHz internal RC oscillator and as such will not provide an accurate clock signal. Eg it might work but a change in temperature or pressure could stop it from running at a precise enough speed to drive the LCD.

kirstom14
Posts: 40
Joined: Thu Nov 15, 2007 9:13 am
Contact:

Re: Connecting a alphanumeric LCD to Flowcode

Post by kirstom14 »

Hi Ben

Yes, the LED is still flashing although no signal on the LCD.
I am thinking that the LCD is not being recognised by the PIC, could it be it???
tomcat14

Post Reply