View previous topic :: View next topic |
Author |
Message |
fushion3
Joined: 28 Sep 2006 Posts: 24
|
LCD test source code? |
Posted: Thu Apr 08, 2010 9:46 am |
|
|
I'm sure this has been done many times, but I can't find a search function on the site, so I'll ask for any LCD test source code for an 16F877A using a 4X20 LCD. Thanks in advance! |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Apr 08, 2010 10:00 am |
|
|
Quote: | I can't find a search function on the site | See "Search" on top of each page, just under the CCS logo.
Example code can also be found in C:\Program Files\PICC\Examples.
I don't have the compiler here, but it looks something like ex_lcd*.c |
|
|
fushion3
Joined: 28 Sep 2006 Posts: 24
|
|
Posted: Thu Apr 08, 2010 10:09 am |
|
|
Yes, I just found the 'search area' once I submitted the post. I was looking for a small "hello World" test for each line of the LCD and didn't want to write something if its been done a 1000 times before. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 08, 2010 10:45 am |
|
|
Look in the Code Library forum. Click on CCS Forum Index in the
upper part of the screen. Then go to Code Library. Look at the Flex
4x20 lcd driver. It has a sample test program. |
|
|
fushion3
Joined: 28 Sep 2006 Posts: 24
|
|
Posted: Thu Apr 08, 2010 1:00 pm |
|
|
I read through the sticky regarding the lcd420 driver & code and found you wrote a couple of each and tried them all with no luck. I have even tried grounding the WR lead and still get rows 2 & 4 having solid pixel illumination. I will say, I'm using a plain breadboard and not a CCS test board, but as long as my pin assignments match all should be OK. I am also using an older version compiler, 2.31 or so, but it has worked just fine so far. Any suggestions are welcome. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 08, 2010 1:12 pm |
|
|
Post the manufacturer and part number of your 4x20 LCD module. |
|
|
dezso
Joined: 04 Mar 2010 Posts: 102
|
|
Posted: Thu Apr 08, 2010 1:14 pm |
|
|
Is your display have 2 "E" line ?
I have not read or checked how is the 4x20 CCS example works, but if you have just a black square's than most likely your LCD has 2x44780 and the second chip not getting initialized at all.
I have 100's Character LCD, 2 Enable line is very common on long"2x80" or tall "4x40"
???
Last edited by dezso on Thu Apr 08, 2010 1:16 pm; edited 1 time in total |
|
|
fushion3
Joined: 28 Sep 2006 Posts: 24
|
|
Posted: Thu Apr 08, 2010 1:15 pm |
|
|
I'm using a Goldentek GC2004A0SHN1B |
|
|
fushion3
Joined: 28 Sep 2006 Posts: 24
|
|
Posted: Thu Apr 08, 2010 1:17 pm |
|
|
The pinouts are:
1 Vss
2 Vdd
3 Vo
4 RS
5 R/W
6 E
7-14 data |
|
|
dezso
Joined: 04 Mar 2010 Posts: 102
|
|
Posted: Thu Apr 08, 2010 1:28 pm |
|
|
yup, that is a ordinary 4x20, GC2004A0SHN1B
My CCS not working and I don't know when I get it up and running again.
It should be simple, check this page to understand how its works, section "2.3.3. 4-line displays". _________________ I'm could be wrong many time's, at least I know what I'm doing |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 08, 2010 1:32 pm |
|
|
Quote: | I am also using an older version compiler, 2.31 or so, but it has worked just fine so far. |
I installed vs. 2.314 (I had it on the original floppy) and it won't compile
the Flex 20x4 lcd driver. It doesn't like the 'int8' declarations. Vs. 2.314
is from early 1997. I know that vs. 2.734, which is from early 2001,
does support 'int8'. Did you go through all the code and change 'int8' to 'int' ?
I'm going to be truthful. I don't want to spend the time to convert all
my code to be 2.314 compatible, just to test it. |
|
|
fushion3
Joined: 28 Sep 2006 Posts: 24
|
|
Posted: Fri Apr 09, 2010 6:16 am |
|
|
Sorry, I must have dyslexia because the version I have is 3.249 not 2.3 as previously mentioned. Your code compiles with no problems, I just have to place all the includes in the same folder to be able to read them. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
fushion3
Joined: 28 Sep 2006 Posts: 24
|
|
Posted: Fri Apr 09, 2010 1:35 pm |
|
|
Yeah, those are the same as my data sheet on the LCD and I have more than double checked them to make sure. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 09, 2010 2:07 pm |
|
|
Quote: |
I still get rows 2 & 4 having solid pixel illumination
|
Post your small, compilable test program. Don't post the Flex driver.
Just include the Flex driver in the test program with an #include
statement. The test program should have an #include for the PIC,
#fuses statement, #use delay(), and a main(). |
|
|
|