Page 1 of 1

LCD question

Posted: Thu Apr 26, 2012 5:59 pm
by TomasS
Hi

I'm having trouples getting the LCD up and running. When using E-blocks there's no problem at all, but when I download the same program to a STK500 and connect a LCD as:

[LCD] [STK500 PORTC HEADER]
1 GND- 9 GND
2 +5V- 10 VCC
3 VLC- LCD contrast control voltage 0..1V
4 RS - 1 PC0
5 RD - 2 PC1
6 EN - 3 PC2
11 D4 - 5 PC4
12 D5 - 6 PC5
13 D6 - 7 PC6
14 D7 - 8 PC7

It's a no-go.

Before using Flowcode, I programmed in C using CodeVision via the connections showed above and didn't have any problems doing so, but I would like to do this in Flowcode as well.

I can see that CodeVision use D4-D7 and Flowcode use Data1 - Data4 - I do not know if this is a problem?

I am running an AVR on a 16MHz crystal.

I hope someone can help me clear out this problem.

BR.
Tomas

Re: LCD question

Posted: Thu Apr 26, 2012 6:29 pm
by dazz
Hi can you post your flowchart as it will be easier for someone to help if they can see your code

Re: LCD question

Posted: Thu Apr 26, 2012 6:43 pm
by TomasS
Of course

It's only a testprogram - so it only consist of a while-loop and a displaymacro.

Re: LCD question

Posted: Thu Apr 26, 2012 7:08 pm
by dazz
Hi i had a quick look at your flowchart, and reread your post, in tyour post you say you have set your stk500 lcd to port c, the flowcode says under lcd connections you are using portD ,try changing the lcd component conections to match the ones in you post portC hope that makes sense.. ive done the changes to your chart and attached it hth

Re: LCD question

Posted: Thu Apr 26, 2012 8:40 pm
by TomasS
Hi dazz

Thanks for you help.
However - The C-code is just taken from a previous project - I have connected the LCD to port D on the E-blocks board and it works here. I then took a 24x2 LCD, that I previous had working on the STK500 - connected it to port D on the STK500 board with the simple test program I send you, but it doesn't seem to work here.

Re: LCD question

Posted: Thu Apr 26, 2012 8:45 pm
by dazz
Hi tomas
im not sure weather you can use a 24x2 i think you can use 16,20 and 40 character displays hth

Re: LCD question

Posted: Thu Apr 26, 2012 9:01 pm
by TomasS
Hi dazz

That´s right, but I have been told that if I select 40 lines, I just have to make sure not to use the last 16 characters - then it should't be a problem.

Re: LCD question

Posted: Thu Apr 26, 2012 9:06 pm
by JohnCrow
Hi Tomas
You say you are using a 2 x 24 lcd.
This size isnt supported in FC though I think it will still work though the last 4 characters in each line may not be usable.
Set to 2 x 20 in FC
I have connected the LCD to port D on the E-blocks board and it works here
Do you mean the Eblock LCD & the Eblocks AVR programmer.
I'm not familiar with the STK500 or AVR devices

Looking at your connections
What is RD? Im not sure what this is for. I dont see a connection for this on the flowchart

On the list above Enable is going to PC2 but on the flowchart its to connected PC1

Re: LCD question

Posted: Thu Apr 26, 2012 9:18 pm
by TomasS
JohnCrow wrote:Hi Tomas
You say you are using a 2 x 24 lcd.
This size isnt supported in FC though I think it will still work though the last 4 characters in each line may not be usable.
Set to 2 x 20 in FC
Hi John

That's a smaller problem - I think, I'll do as you suggest :)

I have connected the LCD to port D on the E-blocks board and it works here
JohnCrow wrote:Do you mean the Eblock LCD & the Eblocks AVR programmer.
I'm not familiar with the STK500 or AVR devices
Yes. I have a EB019 AVR board and connected a EB-005 LCD board to this board. It's no problem having the simple test program executed here.
JohnCrow wrote:Looking at your connections
What is RD? Im not sure what this is for. I dont see a connection for this on the flowchart
RD = Read, but I have never used this option. This isn't used in Flowcode, so I'm not sure what to do with this input.
JohnCrow wrote:On the list above Enable is going to PC2 but on the flowchart its to connected PC1
Perhaps one of my problems?

Re: LCD question

Posted: Thu Apr 26, 2012 9:27 pm
by JohnCrow
Hi Tomas

RD now you say that I remember seeing this in data sheets.
Flowcode does not use the RD option
I built a custom 4 x 20 display, on that its called R/W and I have that line to ground.

Try setting F/C so the enable line is to the same pin on the hardware as in the flowchart and grounding RD
I think as you have it at the moment the enable line is not connected to where the software thinks it is.

Re: LCD question

Posted: Thu Apr 26, 2012 9:40 pm
by TomasS
JohnCrow wrote:Hi Tomas

RD now you say that I remember seeing this in data sheets.
Flowcode does not use the RD option
I built a custom 4 x 20 display, on that its called R/W and I have that line to ground.

Try setting F/C so the enable line is to the same pin on the hardware as in the flowchart and grounding RD
I think as you have it at the moment the enable line is not connected to where the software thinks it is.
Hi again

I will try to make the changes, you suggest in the morning.
Thank you for your help!

BR.
Tomas

Re: LCD question

Posted: Thu Apr 26, 2012 9:47 pm
by JohnCrow
Hi
Ok, hope you can get it sorted now.

Re: LCD question

Posted: Wed May 02, 2012 10:55 pm
by TomasS
JohnCrow wrote:Hi
Ok, hope you can get it sorted now.
Hi John

Sorry I didn't got back to you sooner.
I got the LCD up and running - connected the RW-pin to ground and got the timing right.

So thanks for all your help - I really appreciated it :)

BR.
Tomas

Re: LCD question

Posted: Thu May 03, 2012 7:51 am
by JohnCrow
Hi Tomas

Thats great, glad to hear you've got it sorted