R-Engine-D
Chapter 4: Software
4-17
This function makes repeated calls to
getser
, and will block until
len
bytes are retrieved. The return
value
indicates the number of bytes that were placed into the buffer.
Be careful when you are using this function. The returned character string is actually a byte array
terminated by a null character. This means that there might actually be multiple null characters in the byte
array, and the returned
value
is the only definite indicator of the number of bytes read. Normally, we
suggest that the
getsers
and
putsers
functions only be used with ASCII character strings. If you are
working with byte arrays, the single-byte versions of these functions are probably more appropriate.
Miscellaneous Serial Communication Functions
ware
There
ate for
hatever form of flow control you wish to implement. Before using these functions, you should once
gain be aware that the peripheral pin function you are using might not be selected as needed. For details,
One thing to be aware of in both transmission and receiving of data through the serial port is that TERN
drivers only use the basic serial-port communication lines for transmitting and receiving data. Hard
flow control in the form of
CTS
(Clear-To-Send) and
RTS
(Ready-To-Send) is not implemented.
are, however, functions available that allow you to check and set the value of these I/O pins appropri
w
a
please refer to the Am186ES User’s Manual.
char s
n
_cts(void)
Retrieves value of
CTS
pin.
void s
n
_rts(char b)
Sets the value of
RTS
to
b
.
Completing Serial Communications
our serial communications, you can re-initialize the serial port with s1_init(); to reset
_close
After completing y
default system resources.
s
n
Arguments: COM *c
Return value: none
This closes down the serial port, by shutting down the hardware as well as disabling the interrupt.
The asynchronous serial I/O port available on the Am186ER processor have many other features that might
our application. If you are truly interested in having more control, please read Chapter 12 of
d discussion of other features available to you.
he functions found in this object file are prototyped in
ser1r.h
in the
tern\186\include
directory.
R1 and SER 2 are different than for
SER0.
64 MHz crystal providing the clock signal. This allows for the
be useful for y
the manual for a detaile
4.5
Functions in SER1R.OBJ
T
The SCC26C92 is a component that is used to provide a two additional asynchronous ports. It uses a
3.6864 MHz crystal, different from the system clock speed, for driving serial communications. This means
the divisors and function arguments for setting up the baud rate for SE
The SCC26C92 component has its own 3.68
generation of industry standard baud rates.