that's no longer relevant with today's controllers.Say you have something like a 20 character by 4 line display, and you want to remember what's on it. Either you can keep a copy of the text data in an 80 byte buffer, or you can read it back off your device.
Then there's also reading back the busy flag.
I still doIn the 1980s when these LCDs were introduced, it was common to program controllers in assembler.
I once used the unused character space as auxiliary RAM after a tussle with creeping featureism on a 16C5x system. The Hitachi 44780 has 80 bytes of character RAM but only the physical number of displayed chars have to be used as such (that's why you have to reset the address pointer when changing lines on a shorter than 40ch display). Any display RAM that is 'off the screen' is available.Many LCD's can be read from, but I can't think of a purpose for that capability. What do you use it for?
Without reading the busy flag, one of every 3rd character was being displayed on the 2x16 LCD in my current project.It's not necessary to read the busy flag, LCDs are very fast in normal operations apart from the slow "clear display" command mentioned above by JohnInTX.
You are doing something wrong. Are you certain all characters are being sent?Without reading the busy flag, one of every 3rd character was being displayed on the 2x16 LCD in my current project.
Did you exceed the timing spec as shown in the Hitachi 44780 datasheet?Without reading the busy flag, one of every 3rd character was being displayed on the 2x16 LCD in my current project.
Obviously people are responding to your post without taking the time to actually read your post where you quite correctly point out the use of the busy flag to give the display time to process your character data.That's why I read the busy flag in my code.
I use a hacked up version of it. I used the libs as examples, along with other code, to create my own version. When I was trying to get my LCD to work, I had long delays so I could see the data change and verify it is what I expected. I never went back to using the standard libraries yet.Aside@Brownout: Is that the Microchip XLCD library you are using?
That's a great idea. I'm gonna look into that.While I always use the read function I've been meaning to go back and do a conditional compile to add a delay when you don't use that line.
BrownOut tried doing without the flag and and mentioned it was not working. People are just trying to get his code to work without reading the busy flag. It can be done. While it might be necessary in some applications like sleep as was pointed out above, it certainly isn't necessary in a typical application if proper timing is done. And no one is saying the feature is not useful in certain situations.Obviously people are responding to your post without taking the time to actually read your post where you quite correctly point out the use of the busy flag to give the display time to process your character data.
You correctly point out why and where reading an LCD is useful and/or necessary, but those who have already concluded the opposite will never admit your point.
I only forgot to put in the line that reads the busy flag and observed it doesn't work without it. Then I read a comment that said LCD's are fast and don't need the busy flag read.BrownOut tried doing without the flag and and mentioned it was not working.
Why? It works great, and if I change the clock frequency, I don't need to adjust the dealys in the code. This is the prefered method, IMO.People are just trying to get his code to work without reading the busy flag.
In the beginning,when I first attempted to get the LCD to work ( and I was brand new to PIC programming ) I connected 8 LED's and stepped through the code to make sure correct data was sent to the LCD. I also wrote in long delays so I could observe the data wihtout needed single step. But in my real code, I read the busy flag because that eliminates the need for delay timing.Stepping through the code and sending one character at a time would have revealed a timing issue.
BrownOut tried doing without the flag and and mentioned it was not working. People are just trying to get his code to work without reading the busy flag. It can be done. While it might be necessary in some applications like sleep as was pointed out above, it certainly isn't necessary in a typical application if proper timing is done. And no one is saying the feature is not useful in certain situations.
Stepping through the code and sending one character at a time would have revealed a timing issue.