RX-64
46
You should check TXD_SHIFT_REGISTER_EMPTY_BIT at the time of changing
direction. The following example is a program sending Instruction Packet.
LINE
1
DIRECTION_PORT
=
TX_DIRECTION;
LINE
2
TxDByte(0xff);
LINE
3
TxDByte(0xff);
LINE
4
TxDByte(bID);
LINE
5
TxDByte(bLength);
LINE
6
TxDByte(bInstruction);
LINE 7 TxDByte(Parameter0); TxDByte(Parameter1); …
LINE 8 DisableInterrupt(); // interrupt should be disable
LINE 9 TxDByte(Checksum); //last TxD
LINE
10
while(!TXD_SHIFT_REGISTER_EMPTY_BIT); //Wait till last data bit has been
sent
LINE 11 DIRECTION_PORT = RX_DIRECTION; //Direction change to RXD
LINE 12 EnableInterrupt(); // enable interrupt again
You should be careful of LINEs 8 to 12.
As for LINE 8, it is required since the front part of Status Packet is damaged if Interrupt
Routine is performed longer than Return Delay Time due to the interruption happening
when LINE 8 is executed.
Byte to Byte Time
It means the delay time between bytes when Instruction Packet is transmitted. When this
time exceeds 100msec, RX-64 considers there is a transmission error and waits the
header (0xff 0xff) of packet again.
Connector
Company Name : Molex
0xFF
0xFF
ID
Length
Byte To Byte Time