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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/20/13 15:56
Read: times


 
#189416 - Not protecting RS & RW
Responding to: ???'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            01/01/70 00:00      
   Not protecting RS & RW            01/01/70 00:00      
      init forgets to send            01/01/70 00:00      
      Error correction            01/01/70 00:00      
         Even better...            01/01/70 00:00      

Back to Subject List