This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LCD interface in 8 bit mode.

Hello Everyone,
Generally when interfacing LCD with my controller (AT89C52),in 8 bit mode I use a full port for my data lines. and I get the desired result.

But I have seen many projects where the data lines are split up in to two different ports, d0 to d3 in one port and d4 to d7 in another. Could someone please explain to me how this works or maybe please give me an example to work with.

Thanks in advance,
Arun

Parents
  • Rather than "LCD_PORT = dat;" to output the data on LCD_PORT, you can split it up, in the most extreme case:

    "LCD_D0 = (dat & 0x01)?1:0;" //for dat.0
    "LCD_D1 = (dat & 0x02)?1:0;" //for dat.1
    ...
    "LCD_D7 = (dat & 0x80)?1:0;" //for dat.7

    In cases where you have multiple pins on the same port, you can group them.

Reply
  • Rather than "LCD_PORT = dat;" to output the data on LCD_PORT, you can split it up, in the most extreme case:

    "LCD_D0 = (dat & 0x01)?1:0;" //for dat.0
    "LCD_D1 = (dat & 0x02)?1:0;" //for dat.1
    ...
    "LCD_D7 = (dat & 0x80)?1:0;" //for dat.7

    In cases where you have multiple pins on the same port, you can group them.

Children
No data