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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/02/08 12:36
Read: times


 
#158763 - I am somewhat puzzeled...
Responding to: ???'s previous message
Sunreet:

You have shown in your header file the following:

//LCD Registers addresses
#define EN 0x80
#define RS 0x20


First off, as you have attempted to use these definitions, these are not "Register addresses" but would be more correctly referred to as "register bit definitions".

Secondly when you show the code as below I see the use of some constant LCD_EN that is not shown in your header file:

void lcd_reset()
{
lcd_port = 0xFF;
delayms(20);
lcd_port = 0x03+LCD_EN;
lcd_port = 0x03;


Next you showed some example code as below that introduces yet another constant LEN not shown in the header file.

i'll give you an example

lcd_port = (((dat >> 4) & 0x0F)|LEN|RS);


Lastly I may suggest that you may want to just give the following change a try. Change your typical code as here:

void lcd_data (unsigned char dat)
{
lcd_port = (((dat >> 4) & 0x0F)|EN|RS);
lcd_port = (((dat >> 4) & 0x0F)|RS);


....to something like this:

void lcd_data (unsigned char dat)
{
lcd_port = (((dat >> 4) & 0x0F)|RS);
lcd_port = (((dat >> 4) & 0x0F)|EN|RS);
lcd_port = (((dat >> 4) & 0x0F)|RS);


Michael Karas






List of 29 messages in thread
TopicAuthorDate
lcd port switching problem            01/01/70 00:00      
   P0 does not have internal pull-ups            01/01/70 00:00      
   P1 or P2 should work similarly            01/01/70 00:00      
   i do know that about P0            01/01/70 00:00      
      But how about the control defs            01/01/70 00:00      
         yes i have moved them as well            01/01/70 00:00      
         here is the lcd part of the code            01/01/70 00:00      
            correct me if i am wrong            01/01/70 00:00      
               Tried everything?            01/01/70 00:00      
      Again, I guess you are mixing            01/01/70 00:00      
         could you please poin it out in the code            01/01/70 00:00      
   header file            01/01/70 00:00      
      the above show NOTHING, but here is a guess            01/01/70 00:00      
   hardware problem?            01/01/70 00:00      
      errors not consistent            01/01/70 00:00      
         I am somewhat puzzeled...            01/01/70 00:00      
            come conufusion with the file            01/01/70 00:00      
               My suggestion was to...            01/01/70 00:00      
                  will try that michael            01/01/70 00:00      
         Multimeter is enough            01/01/70 00:00      
            will try that out            01/01/70 00:00      
               Tests both sw and hw            01/01/70 00:00      
   lcd simulator (from keil)            01/01/70 00:00      
      i do not know your chip ...            01/01/70 00:00      
         keep in reset as in ?            01/01/70 00:00      
            if open collector supervisor and reset low            01/01/70 00:00      
   the lcd worked on P0 with pull ups            01/01/70 00:00      
      which processor?            01/01/70 00:00      
         AT89C52            01/01/70 00:00      

Back to Subject List