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

HELP!

Dose anybody know the purpose of doing this

void Send_CmdNo(unsigned char command){

  CSX=0;
  RDX=1;
    D_CX=0;
        DBUS=command;
        WRX=0;
        WRX=0;
        WRX=0;
        WRX=1;
  CSX=1;
}

why use WRX=0 3 times b4 WRX=1?
wouldn't that just give you WRX=1?

by the way WRX is just

sbit WRX        = P7^2;

does it mean on the I/O pin the output will send out
0 three times and 1 one time? It performs that fast?

Parents
  • Since no one actually answered your request, here goes.

    This looks like a byte wide interface to a peripheral with ChipSelect(CSX), Read(RDX), Data/Command(D_CX), and Write(WRX) using individual I/O pins and DBUS as the eight bit bus.

    The first line "CSX=0" drives the Chip Select low and selects the device. Note: the chip select remains low till the last instruction of the function.

    Subsequent lines set Command mode, put the data on the bus, and pulse the Write line (a normally high signal with a low going pulse to write data).

    WRX=0 repeated three times does not actually change the port pin three times, it just kills time, perhaps to allow the peripheral time to capture the incoming data.

Reply
  • Since no one actually answered your request, here goes.

    This looks like a byte wide interface to a peripheral with ChipSelect(CSX), Read(RDX), Data/Command(D_CX), and Write(WRX) using individual I/O pins and DBUS as the eight bit bus.

    The first line "CSX=0" drives the Chip Select low and selects the device. Note: the chip select remains low till the last instruction of the function.

    Subsequent lines set Command mode, put the data on the bus, and pulse the Write line (a normally high signal with a low going pulse to write data).

    WRX=0 repeated three times does not actually change the port pin three times, it just kills time, perhaps to allow the peripheral time to capture the incoming data.

Children