Pages: [1]   Go Down
Author Topic: How To Write to LCD (2x16) Without Using LiquidCrystal Library?  (Read 2664 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello and thank you! I was able to hookup my Arduino with a very simply LCD and program it to show different sentences and unique characters.
Now I am looking to learn how the fundamentals of electronics work by figuring out how the LCD works. And I will accomplish this by learning to display the letter 'A' without using any library.
So I request please if anyone has a link to a good tutorial or journal or article, I'd really appreciate it.
I already have the source code for the LiquidCrystal library, and although I can sort of make out what the code is actually doing, I have no clue how or why it is doing it. That is to say, I don't know how the LCD internally interprets the state of the data pins, enable pin, and register pin to render a letter or sentence. And when I say how, I don't mean physically. I mean like,
Code:
//Code on the LCD end
if((enable pin is high) and (register pin is high) and (data pin 1 is on))
  then turn on block one of the top left most character
I will eventually figure out how signals are internally interpreted but I hope you get the gist of what I am saying is. I want to learn how to tell the LCD to turn on an induvidual block of one character. I don't know the proper engineering term for it sorry lol. Like. If you isolate one of the 7x5 blocks. I want to know how to turn on the block inside of the block that is at 1colx1row.

I really really appreciate it!
« Last Edit: April 16, 2013, 07:56:24 pm by 012anonymousxyz » Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 518
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi 012anonymousxyz.

 Maybe this is not what you are looking for but it may help. It shows how you can control an LCD with just simple switches, but you do need a monostable input to the RS line of the LCD to prevent multiple clock signals

http://lcd-linux.sourceforge.net/pdfdocs/lcd1.pdf
Logged


0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 89
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To use the common 44780 based LCDs, look for 44780 tutorials.  There are a lot of them including videos.  As an example, this one looks like it will help http://joshuagalloway.com/lcd.html

This is more of a list of commands than a tutorial but when I started playing with LCDs, this one http://www.geocities.com/dinceraydin/lcd/commands.htmenabled me to write my own library.  I thought it was very helpful.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 4435
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The link posted by Pedro (http://lcd-linux.sourceforge.net/pdfdocs/lcd1.pdf) has a second part that discusses microprocessor control of the LCD but it may be of limited help since it is written in assembly language, written for a PIC processor, and doesn't exactly follow the manufacturers recommended initialization procedure (but neither does the LiquidCrystal library).  It will, however, give you an idea of what you have to do.

The first link posted by Arlo (http://joshuagalloway.com/lcd.html) is not a lot more than a rehash of the data sheet and it doesn't even include the very necessary timing diagrams.  His initialization sequence does not follow the manufacturers recommendations either.

Arlo's second link ( http://www.geocities.com/dinceraydin/lcd/commands.htm) does have a lot of interesting information but will be of most use after you get your device functioning in the first place.

One of the first things you have to do is initialize the LCD controller.  You can find out what you have to do by following the LCD Initialization link at http://web.alfredstate.edu/weimandn.  At some point you will want to position the cursor so it helps to know how the addressing works.  Follow the LCD Addressing link to find out more about that aspect.

I suggest that you start out using the 8-bit data interface and do not attempt to read the 'busy-flag'.  The first part means that you will tie up four more I/O lines on your Arduino but it makes the programming a lot more straightforward.  The second part means that you do not have to implement the RW line (LCD pin 5), just connect it to GND.


Don
Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 518
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the link to the second part of the microprocessor control of the LCD

http://lcd-linux.sourceforge.net/pdfdocs/lcd2.pdf
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 4435
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just re-read the original post and I see that we all seem to have misinterpreted what he wants to do.  We were thrown off by the title of the thread and by his mention of the LiquidCrystal library and thus formulated our answers based on the control of a character mode LCD driven by a controller such as the HD44780.

If you look at the part below his program code block it says "
... I want to learn how to tell the LCD to turn on an induvidual block of one character. I don't know the proper engineering term for it sorry lol. Like. If you isolate one of the 7x5 blocks. I want to know how to turn on the block inside of the block that is at 1colx1row.".

Well except for the very limited exception of the eight available custom characters this is just not possible for a character mode display.  In order to do what he wants to do you should be looking into a graphical LCD not a character mode LCD.


Don
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Phew, sorry. I have a lot of ongoing projects in my classes and it was a busy week for tests and stuff.
I appreciate all the responses and I'm tbh a little overwhelmed but I got the links and will work through them.

I really appreciate the responses and thank you very much!
Logged

Pages: [1]   Go Up
Jump to: