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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/26/13 19:24
Read: times


 
#189488 - Data Display loop
Responding to: ???'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            01/01/70 00:00      
   Comments, please            01/01/70 00:00      
      Comments            01/01/70 00:00      
         Code Fragments            01/01/70 00:00      
            Commenst added, reply to hal            01/01/70 00:00      
               comments            01/01/70 00:00      
                  comments            01/01/70 00:00      
                     Program flow            01/01/70 00:00      
                        comments            01/01/70 00:00      
                           Clarification & Suggestions            01/01/70 00:00      
                              GREAT HELP            01/01/70 00:00      
                                 Data Display loop            01/01/70 00:00      
                                    Worked sorta            01/01/70 00:00      
                                       The output            01/01/70 00:00      
                                          I looked at it wrong            01/01/70 00:00      
                                             Works            01/01/70 00:00      
                                                Great news!            01/01/70 00:00      
                                                   Thank you            01/01/70 00:00      
                                                      You're Welcome            01/01/70 00:00      
                                                      A couple of questions            01/01/70 00:00      
                                                         Answers and questions            01/01/70 00:00      
                                                            Thanks            01/01/70 00:00      

Back to Subject List