CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Flexible LCD driver for 20x4 LCDs
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

PostPosted: Tue Feb 05, 2008 3:51 pm     Reply with quote

ELCouz wrote:
Built-in. The SPLC780A1 is compatible with the factory standard HD44780 controller

Thank you. I was looking at the datasheet for the controller and it doesn't make any sense if it is not built in...then you have 100+ pins to solder.
maxrate



Joined: 01 Jan 2007
Posts: 38
Location: Mississauga, Ontario, Canada

View user's profile Send private message

Flexible driver
PostPosted: Mon Oct 13, 2008 4:26 pm     Reply with quote

This code worked first try with my CrystalFontz display. Thank you to who ever modified the original CCS code, saved me a lot of time.
Bill Legge



Joined: 07 Sep 2010
Posts: 24
Location: West Australia

View user's profile Send private message

Flex420
PostPosted: Sat Sep 18, 2010 12:04 am     Reply with quote

Thanks for your work. I started on CCS C a few days ago and got your driver working first time.

May help someone else to know that my target was:

ETT/Futurlec ET-BASE PIC8722 board
With a 4X20 LCD connected in 'standard' ETT format to the PORTH socket

All works very well. Just watch where you store the downloaded driver so that the main.c program can find it.

If you have not had a look at the Futurlec boards - do so. They are good value for money and arrive in about 10 days. Documentation is poor but understandable.

Regards Bill Legge
In Australia
_________________
Denmark in West Australia
'Where the forest meets the sea'
sayse



Joined: 20 Sep 2010
Posts: 1

View user's profile Send private message

PostPosted: Mon Sep 20, 2010 11:59 pm     Reply with quote

wired57 wrote:
I was unable to make your driver function aswell, until I modified these Two functions, so that they followed the need to hold the R line high for 220uS min and then Low for another 220uS min, with a toltal cycle time of 500uS min. for both reading and writing. this is for a 4x20 based on a Samsung KS0066 Controler. let me know if this helps others too.


Thankyou, it was so helpful to me, I used 100us instead 220 but it didn´t work with the original values.
Another change I made is cancel this instruction in lcd_send_byte

// while(bit_test(lcd_read_byte(),7)) ;

Because the software hang on there since I don´t use the RW_PIN, I know the driver has this #IF statements but it hangs on anyway. Now it´s working properly.
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

7 Data Pins
PostPosted: Tue Jun 05, 2012 10:15 am     Reply with quote

Hello,

I really like this driver as it saves time and frustration over the default one, I have not received the LCD in the mail yet however I know that it has 7 data pins, rs, rw, and E pins, and in this driver there are only defines for DB4 - DB7, are the other DB pins unneeded? Thanks in advance (LMB204BDC is my LCD by the way).

EDIT: nevermind, it's in 4 bit mode right? In the mean time, has anyone tried this driver with the LMB204BDC?
http://www.topwaydisplay.com/Pub/Manual/LMB204BDC-Manual-Rev0.1.pdf
Abyss



Joined: 20 Mar 2014
Posts: 1

View user's profile Send private message

PostPosted: Thu Mar 20, 2014 6:49 am     Reply with quote

Neckruin wrote:
Forget it... it works perfectly! Smile
Thanks again PCM.

PD: Just for laughing... the problem was the contrast... Embarassed



Dear Sir,

I hereby give you as many thanks as possible!!!! Very Happy

I spent quite some hours trying to solve this, and I was afraid I needed to check the timings on my xlcd.c code...it was the contrast after all! Just a variable resistor and "Hello world"!!!!!

Really, thank you from the bottom of my heart!! Razz Razz Razz
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Thu Sep 25, 2014 8:26 pm     Reply with quote

Not that it needs saying, but this works perfectly!

Winstar 20*4

Thanks PCM!
G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Fri Oct 03, 2014 12:19 pm     Reply with quote

After some more fiddling with this driver i noticed that '\r' is not a valid command.

how do i write over the same line? like a constantly updating temp value?

do i have to use the lcd_gotoxy or is there a direct way from the lcd_putc function?

basically do this : Printf("Value: %u \r", Temp);

G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 03, 2014 1:36 pm     Reply with quote

Do you have a recent version of the CCS compiler ? CCS added a feature
to their lcd.c file called "LCD_EXTENDED_NEWLINE". If that is defined
they create two global variables for lcd_x and lcd_y. Then in the rest of
the driver, they update those to keep track of the current cursor position.

Then in the lcd_putc() routine, they add a case for \r:
Code:
case '\r'   :  lcd_gotoxy(1, g_LcdY+1);   break;

Basically, they're keeping track of what Y line you're on, so when you
send \r, the driver knows what Y coordinate to put into lcd_gotoxy().

You could add that feature to the 20x4 driver. Or if you don't have a
recent version to refer to, I could add the mods.
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Fri Oct 03, 2014 2:48 pm     Reply with quote

hi, Thanks for the explanation.

I have 4.135 for PCM and 5.012 for PCH...

The drivers i have do have the Extended Newline, but only for the 16x2.
I can try to mod the code but I dont think anybody should hold their breaths...
Lets see how i do tonight.

Thanks.
G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Fri Oct 03, 2014 3:10 pm     Reply with quote

Looking at the code:

Code:
void lcd_putc(char c)
{
 switch(c)
   {
    case '\f':
      lcd_send_byte(0,1);
      lcd_line = 1;
      delay_ms(2);
      break;
   
    case '\n':
       lcd_gotoxy(1, ++lcd_line);
       break;
   
    case '\b':
       lcd_send_byte(0,0x10);
       break;
   
    default:
       lcd_send_byte(1,c);
       break;
   }
}



case '\n': goes to the 1 position of the next "lcd_line"

Why not just add a case like this:

Code:
    case '\r':
       lcd_gotoxy(1, lcd_line);
       break;


Basically going to the first position of the very same line?

I dont see "lcd_line" being updated anywhere else...so if called during a print it should hold the value of the line after the last '\n'

I'm probably missing something.... i dont think ccs and you missed that short cut...
_________________
CCS PCM 5.078 & CCS PCH 5.093
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 03, 2014 4:24 pm     Reply with quote

I don't see lcd_line updated in the lcd_gotoxy() routine.

In order to do this, I will have get out a board, connect up the 20x4 lcd
and test it all out. I was sort of hoping I could avoid that. I am tired today.
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Fri Oct 03, 2014 7:52 pm     Reply with quote

.... kick back, im taking this one on myself in about 10 mins.

EDIT: So far.. its working!
Im going to sort some other things out and post back the finished code!
_________________
CCS PCM 5.078 & CCS PCH 5.093
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

Rejoice with '\r'
PostPosted: Fri Oct 03, 2014 8:25 pm     Reply with quote

Hi All, This is the modified function as per the discussion above:
Seems to work just fine and now we can all rewrite lines at will with '\r'.
Ive included the line wrap from user "ratgod" as well, i thought it was practical too.

Code:
void lcd_putc(char c)
{
 switch(c)
   {
    case '\f':
      lcd_send_byte(0,1);
      lcd_line = 1;
      delay_ms(2);
      break;
   
    case '\n':
       lcd_gotoxy(1, ++lcd_line);
       break;
   
    case '\b':
       lcd_send_byte(0,0x10);
       break;
    case '\r':
       lcd_gotoxy(1, lcd_line);
       break;
    default:
       lcd_send_byte(1,c);
       break;
   }
  if (lcd_line>4)
     {
       lcd_line=1;
     }
}

_________________
CCS PCM 5.078 & CCS PCH 5.093
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Tue Apr 14, 2015 11:32 pm     Reply with quote

Hi, Can you confirm that this driver using a 6 pin configuration (NO RW), will work with a 3.3V Pic and a 5V LCD?

I dont see any reason it should not, but id like to know if some one else has done this.

Thanks
G
_________________
CCS PCM 5.078 & CCS PCH 5.093
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group