AN2262 Motorola / Freescale Semiconductor, AN2262 Datasheet - Page 30

no-image

AN2262

Manufacturer Part Number
AN2262
Description
Wireless HC08 Modem
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
AN2262/D
SCI Operation
SCI Timeout
Detection
30
Another part of the application is the serial communication interface (SCI). A set
of universal routines have been used within this application. The main features
configurable at compile time are:
All functions are declared in
required, the timing features are defined through one function in
tbm.c.
The RF-08 application has been mainly targeted to transfer non-continuous
blocks of data which are not of fixed length. If so, some method needs to be
used to specify the moment when SCI reception is considered to be finished
(interrupted) and retransmission to the RF medium shall start.
There were basically two methods to choose from:
The idle line detection uses the SCI hardware to detect the idle line condition.
The condition is met when 10 or 11 consecutive logical 1’s shift in from the RxD
pin. Such a condition can set the appropriate SCI flag and generate an
interrupt.
Since the used source of SCI data (typically a PC with Windows
doesn’t ensure that an idle condition won’t appear in between bytes that are
sent through standard Windows I/O routines, the timeout detection method is
used in this application instead.
This works quite simply: a timebase module (TBM) generates a ‘slow’
periodical interrupt every millisecond. In each SCI receive interrupt service
routine the timeout variable is cleared and during every TBM interrupt this
variable is incremented by one. If a value of two is reached, the timeout
condition is signalled to the main loop.
1. Windows is a registered trademark of Microsoft Corporation in the U.S. and/or other countries.
Two independent (receive and transmit) ring buffers — static (fixed
length) or dynamic buffer allocation can be selected
Selectable RS232 (full-duplex) or RS485 (half-duplex or full-duplex)
mode of operation
Hardware flow control (RTS/CTS) mode in RS232 mode
Software flow control (XON/XOFF) mode in RS232 mode
Idle line or timeout detection of the ‘End-Of-SCI-Frame’ condition
Idle line detection
Timeout detection
Wireless HC08 Modem
sci.h
and defined in sci.c. If timeout detection is
®(1)
tbm.h
MOTOROLA
OS)
and

Related parts for AN2262