Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Hal Albach
02/26/13 12:24
Read: 918 times
Seminole, Florida
USA


 
#189488 - Data Display loop
Responding to: James Brzycki's previous message
"So for displaying all three parts of the data I would use the INC command like in the conversion blocks?"
No, here you would decrement (DEC) R1. Here's why: As I pointed out at the end of my last post, when your code enters the DATA_DISPLAY: block, R1 will be pointing to the most significant byte holding the data to be displayed, which I believe will be location 52H. When sending data to display on an LCD the first character is written to the location you specified, which will be the leftmost position. The LCD controller chip then internally increments its pointer to the next position to the right and waits for your next charracter. It's just like writing the numbers on paper, you start with the leftmost digit and proceed to the right to the rightmost digit, which will be the units position. Let's suppose the temperature reading was 235 degrees. After the conversions the 2 will be in location 52H, the 3 in 51H, and the 5 in 50H. Now as mentioned earlier, R1 is already pointing to location 52H, which holds the leftmost digit. Send it to the display, then DECREMENT R1 so that it now points to 51H. Send that to the display and do it again once more for location 50H.
Now for the delay needed by the display.
I'm going to assume (I know, very dangerous!) that the controller chip for your LCD is the HD44780, widely used in many displays. My datasheet for that device indicates that nearly all operations require 40 microseconds to complete with the exception of CLEAR DISPLAY and CURSOR HOME, which require 1.64 milliseconds. Reading the BUSY FLAG requires no delay at all. What you will need to do is look up the data sheet for your CPU and determine what the execution time is for the instructions in the delay routine and then tailor your delay according to the display requirements. Also, the first part of LCD initialization requires additional delays. In your case, since the display is responding correctly I would leave the delays as is in the init section until you actually start sending the display characters, then cut the time to 40 microseconds.


Hal

List of 22 messages in thread
TopicAuthorDate
How to display data from a ADC0808 to a LCD      James Brzycki      02/24/13 09:46      
   Comments, please      Hal Albach      02/24/13 17:25      
      Comments      James Brzycki      02/24/13 17:56      
         Code Fragments      Hal Albach      02/24/13 21:01      
            Commenst added, reply to hal      James Brzycki      02/24/13 21:11      
               comments      Hal Albach      02/24/13 22:46      
                  comments      James Brzycki      02/25/13 06:33      
                     Program flow      Hal Albach      02/25/13 11:40      
                        comments      James Brzycki      02/25/13 21:45      
                           Clarification & Suggestions      Hal Albach      02/26/13 07:44      
                              GREAT HELP      James Brzycki      02/26/13 11:39      
                                 Data Display loop      Hal Albach      02/26/13 12:24      
                                    Worked sorta      James Brzycki      02/27/13 06:57      
                                       The output      Hal Albach      02/27/13 15:29      
                                          I looked at it wrong      James Brzycki      02/27/13 17:19      
                                             Works      James Brzycki      02/27/13 20:35      
                                                Great news!      Hal Albach      02/28/13 07:05      
                                                   Thank you      James Brzycki      02/28/13 07:15      
                                                      You're Welcome      Hal Albach      02/28/13 08:33      
                                                      A couple of questions      Hal Albach      02/28/13 11:06      
                                                         Answers and questions      James Brzycki      02/28/13 11:54      
                                                            Thanks      Hal Albach      02/28/13 12:36      

Back to Subject List