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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/21/07 02:42
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#147287 - Logical operations
Responding to: ???'s previous message
In your two WRITE operations you move DATA to B and then ORL B with 0F0h but then do nothing with the result. Also, ORL sets bits, it won't clear them. When you ORL with 0F0h the left nibble is set to 1111 and the right nibble is left alone.
ANL with 0F0h will leave the left nibble as is and set the right nibble to 0000.


The fifth statement under WRITE_TEXT you are moving the contents of Acc to port 2 with an ANL operation. I don't think you want to do this since ANL will bitwise AND the contents of Acc with whatever is currently on the port from previous operations. Instead of ANL simply use MOV.

Also, since you have placed RS and EN on the same port with data you must maintain complete control of the state of EN during your setups so that moving data to the port does not inadvertently toggle EN and throw everything off. You might want to consider using a one byte memory location or register to set up what is needed, then just move the byte to the port.

Hal

List of 16 messages in thread
TopicAuthorDate
4 bit LCD trouble            01/01/70 00:00      
   Possible Error            01/01/70 00:00      
      DATA is port EN is pin            01/01/70 00:00      
   Initialization            01/01/70 00:00      
      I think I did initialize correct            01/01/70 00:00      
   Logical operations            01/01/70 00:00      
   Oops, should have been ANL BA            01/01/70 00:00      
      Clobbering your data            01/01/70 00:00      
   topic gone??            01/01/70 00:00      
      code library            01/01/70 00:00      
   Try LCD Tutorial in tutorials section            01/01/70 00:00      
      Tutorial uses 2 ports            01/01/70 00:00      
         previous comments...            01/01/70 00:00      
            All tested an nailed the problem            01/01/70 00:00      
               yes, timing            01/01/70 00:00      
   Some code shortening:            01/01/70 00:00      

Back to Subject List