20-151-0178 Rabbit Semiconductor, 20-151-0178 Datasheet - Page 133

CABLE CONVERTER RS-232 TO USB

20-151-0178

Manufacturer Part Number
20-151-0178
Description
CABLE CONVERTER RS-232 TO USB
Manufacturer
Rabbit Semiconductor
Datasheet

Specifications of 20-151-0178

Accessory Type
USB to RS232 Adapter
Product
Microcontroller Accessories
For Use With/related Products
Rabbit-based Boards
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
20-151-0178
316-1181
DESCRIPTION
RETURN VALUE
SEE ALSO
RabbitFLEX User’s Manual
void ser485Tx(void);
Enables the RS-485 transmitter. The brdInit() function must be executed before running this
function. This function is non-reentrant.
After the byte or block of data has been transmitted, the RS-485 transmitter must be idle and its
transmit buffer empty before an application can disable the transmitter and thus receive data from
the RS-485 interface. There are two methods for identifying when to disable the transmitter.
1. Poll the receive data buffer for the transmitted data that is echoed back to it. This is the easier
2. Read SxSR, the status register of the serial port you are using. Bits 2 and 3 report on the RS-485
None
brdInit
method. The following code snippet illustrates disabling the transmitter after one byte has been
transmitted using serial port C. You can also send a block of data before disabling the transmit-
ter.
transmitter and its buffer. The following code snippet illustrates how to check these bits if you
are using serial port C.
ser485Tx();
serCputc ( 0x55 );
while (serCgetc() == -1);
ser485Rx();
ser485Tx();
serCputc(0x55);
// Wait for Tx Data buffer to become empty
while(serCwrFree() != COUTBUFSIZE);
// Wait for Tx buffer and shift register on uP to become empty
while(RdPortI(SCSR)&0x08 || RdPortI(SCSR)&0x04);
ser485Rx();
,
ser485Rx
ser485Tx
www.rabbit.com
// enable transmitter
// send byte
// wait for echo
// disable transmitter
127

Related parts for 20-151-0178