Page 1 of 3

Connecting a alphanumeric LCD to Flowcode

Posted: Thu Dec 13, 2007 5:05 pm
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.

Crystal Frequency and displays

Posted: Wed Jan 09, 2008 2:13 pm
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Mon Jan 14, 2008 11:19 am
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Tue Jan 15, 2008 3:25 pm
by Gnu
Do the pins 7-10 need to be grounded or is it OK to leave them floating?

Gnu

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Tue Jan 15, 2008 5:42 pm
by Benj
Hello Gnu

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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Tue Jan 22, 2008 5:22 pm
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Tue Jan 22, 2008 6:15 pm
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Tue Jan 22, 2008 6:44 pm
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 10:40 am
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 11:27 am
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 12:05 pm
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 1:49 pm
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 2:05 pm
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?

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 5:33 pm
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Wed Jan 23, 2008 6:09 pm
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Thu Jan 24, 2008 10:58 am
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Thu Jan 24, 2008 1:28 pm
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Thu Jan 24, 2008 5:49 pm
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?

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Thu Jan 24, 2008 6:09 pm
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Thu Jan 24, 2008 11:43 pm
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....

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Fri Jan 25, 2008 10:15 am
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

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Fri Jan 25, 2008 10:31 am
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Fri Jan 25, 2008 4:26 pm
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;

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Fri Jan 25, 2008 5:44 pm
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.

Re: Connecting a alphanumeric LCD to Flowcode

Posted: Fri Jan 25, 2008 6:26 pm
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???