Question regarding Stampworks experiment #11: basic LCD demonstration
almost_human
Posts: 7
Hello,
I'm an electronics hobbyist and new to microcontroller programming. Currently I'm working on Stampworks experiment #11. The experiment is a simple program to control the 2x16 parallax LCD display. I read and understand most of the source code but i have a few questions. The time duration argument of the PULSOUT command being used for the Enable pin is sometimes 3 and sometimes 1. The book offers no explaination on this. I would like to know why sometimes 3 is used and sometimes 1 is used. I know it has something to do with instruction execution time stated in the datasheet of the Hitashi HD44780U LCD driver but i come up with a different number for the PULSOUT duration argument when calculating instruction execution time of the LCD.
Also another question I have is, when initializing the LCD by instruction for 4 bit interface, the datasheet says to pause for more than 100us but the code doesn't pause for that. Why doesn't the code pause for this and how will this affect the initialization of the LCD?
I hope someone that's familiar with programming the LCD can clear this up for me. Any help would be greatly appreciated.
I'm an electronics hobbyist and new to microcontroller programming. Currently I'm working on Stampworks experiment #11. The experiment is a simple program to control the 2x16 parallax LCD display. I read and understand most of the source code but i have a few questions. The time duration argument of the PULSOUT command being used for the Enable pin is sometimes 3 and sometimes 1. The book offers no explaination on this. I would like to know why sometimes 3 is used and sometimes 1 is used. I know it has something to do with instruction execution time stated in the datasheet of the Hitashi HD44780U LCD driver but i come up with a different number for the PULSOUT duration argument when calculating instruction execution time of the LCD.
Also another question I have is, when initializing the LCD by instruction for 4 bit interface, the datasheet says to pause for more than 100us but the code doesn't pause for that. Why doesn't the code pause for this and how will this affect the initialization of the LCD?
I hope someone that's familiar with programming the LCD can clear this up for me. Any help would be greatly appreciated.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I am attaching what I think is a more usefull example and it only uses the PULSOUT pin, 3 when it is actually sending data or a command. Also learning how to send data or a command require RS to be hi or low, look for it in the program. The code example is by Ken Gracy.
Also the data sheet says you need to send the initial command 3 times, but that command· remains on the pins until they are changed. So after the command all that is required, is the initial Enable, the initial long pause and 2 more Enables.
Post Edited (Capt. Quirk) : 8/26/2007 5:50:56 PM GMT
Thanks for the example code Capt. Quirk, it's helpful to see another program written for the LCD. Are you saying that 3 was used arbitrarily just so the LCD will have plenty of time to execute the instruction? But why 3, why not 2, 5 or 10?
Post Edited (Capt. Quirk) : 8/27/2007 6:32:34 AM GMT