defining port wirh reverse order

Hi,

I will use a 4-bit LCD with 8051.
But there is a problem, LCD's data pins are connected in reverse order.
i.e.
D7 to P2^0
D6 to P2^1
D5 to P2^2
D4 to P2^3

My previosly written program uses a port called Data which is defined as
#define Data P2

Now i want to simple change the "Data" definition with reversed ordered P2 pins, without changing the program itself.

How can i do this?

Parents
  • My previosly written program uses a port called Data which is defined as #define Data P2.
    Now i want to simple change the "Data" definition with reversed ordered P2 pins, without changing the program itself.
    How can i do this?
    ?

    1) if "My previosly written program" is actually written (not copied) by you you do not need to ask
    2) the only way to do this "without changing the program itself" is by making a new board with the pins in the right order.
    3) The change to the program is one that anyone that is actually themselves capable o writing a program to drive a LCD should have no problem whatsoever with.

    Erik

Reply
  • My previosly written program uses a port called Data which is defined as #define Data P2.
    Now i want to simple change the "Data" definition with reversed ordered P2 pins, without changing the program itself.
    How can i do this?
    ?

    1) if "My previosly written program" is actually written (not copied) by you you do not need to ask
    2) the only way to do this "without changing the program itself" is by making a new board with the pins in the right order.
    3) The change to the program is one that anyone that is actually themselves capable o writing a program to drive a LCD should have no problem whatsoever with.

    Erik

Children
More questions in this forum