User’s Manual
81
B.4.3.1 RS-232
RS-232 serial communication on the RCM3600 Prototyping Board is supported by an
RS-232 transceiver installed at U4. This transceiver provides the voltage output, slew rate,
and input voltage immunity required to meet the RS-232 serial communication protocol.
Basically, the chip translates the Rabbit 3000’s signals to RS-232 signal levels. Note that
the polarity is reversed in an RS-232 circuit so that a +5 V output becomes approximately
-10 V and 0 V is output as +10 V. The RS-232 transceiver also provides the proper line
loading for reliable communication.
RS-232 can be used effectively at the RCM3600 module’s maximum baud rate for distances
of up to 15 m.
RS-232 flow control on an RS-232 port is initiated in software using the
serXflowcon-
trolOn
function call from
RS232.LIB
, where
X
is the serial port (C or D). The locations
of the flow control lines are specified using a set of five macros.
SERX_RTS_PORT
—Data register for the parallel port that the RTS line is on (e.g., PCDR).
SERA_RTS_SHADOW
—Shadow register for the RTS line's parallel port (e.g., PCDRShadow).
SERA_RTS_BIT
—The bit number for the RTS line.
SERA_CTS_PORT
—Data register for the parallel port that the CTS line is on (e.g., PCDRShadow).
SERA_CTS_BIT
—The bit number for the CTS line.
Standard 3-wire RS-232 communication using Serial Ports C and D is illustrated in the
following sample code.
#define CINBUFSIZE 15 // set size of circular buffers in bytes
#define COUTBUFSIZE 15
#define DINBUFSIZE 15
#define DOUTBUFSIZE 15
#define MYBAUD 115200 // set baud rate
#endif
main(){
serCopen(_MYBAUD); // open Serial Ports C and D
serDopen(_MYBAUD);
serCwrFlush(); // flush their input and transmit buffers
serCrdFlush();
serDwrFlush();
serDrdFlush();
serCclose(_MYBAUD); // close Serial Ports C and D
serDclose(_MYBAUD);
}
Содержание RabbitCore
Страница 1: ...RabbitCore RCM3600 C Programmable Core Module User s Manual 019 0135 050630 C ...
Страница 6: ...RabbitCore RCM3600 ...
Страница 12: ...6 RabbitCore RCM3600 ...
Страница 92: ...86 RabbitCore RCM3600 ...
Страница 128: ...122 RabbitCore RCM3600 ...
Страница 132: ...126 RabbitCore RCM3600 ...
Страница 136: ...130 RabbitCore RCM3600 ...
Страница 138: ......