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/20/13 08:56
Read: 956 times
Seminole, Florida
USA


 
#189416 - Not protecting RS & RW
Responding to: Shruthi Rajan's previous message
If you are going to use P2 for data AND control you have to ensure that when you move the data to the port that you do not destroy the RS & RW settings.
In "lcd_data:" you set up RW & RS at the port, isolate the upper and lower nibbles to U & L and then move them to A as a byte. In "loop:" you simply dump A to Port 2, destroying RS & RW.

When you move U or L to A, set bits 5 & 6 in A so that RS & RW won't be modified when you dump A to the port. In fact, as long as you are going to dump A to the port, defining RS & RW at the port is meaningless, because A is going to override whatever you set P2.4 and P2.5 to.

Hal

List of 5 messages in thread
TopicAuthorDate
4-bit lcd on 8051      SHRUTHI RAJAN      02/20/13 04:40      
   Not protecting RS & RW      Hal Albach      02/20/13 08:56      
      init forgets to send      Maarten Brock      02/20/13 14:32      
      Error correction      Hal Albach      02/20/13 19:25      
         Even better...      Michael Karas      02/20/13 20:39      

Back to Subject List