AN2262 Motorola / Freescale Semiconductor, AN2262 Datasheet - Page 24

no-image

AN2262

Manufacturer Part Number
AN2262
Description
Wireless HC08 Modem
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
AN2262/D
OC Interrupt Service
Routine
24
NOTE:
This method is insensitive to any latencies which may occur (e.g., when some
other source of interrupt is being serviced). The only limitation is that the actual
OC interrupt service routine must complete before the next output compare
event occurs. This is demonstrated in
slightly shifted (delayed) after the output compare event, for example, until
another interrupt service routine (which is not interrupted by the OC ISR)
finishes its job.
The same code can be used to generate NRZ data stream. Clearing the
‘Toggle on overflow’ feature, no toggle in the middle of the bit occurs. For
example, this method could be helpful in generating a ‘software-SCI’ data
stream.
Since the transmit routine is a core part of the application, a more detailed
explanation of its function follows.
flows. It must be understood that this routine is periodically called at a bit rate,
right after an output compare event. The flow branches depending on whether
data (pay-load) or special (RF specific) symbols are to be sent. Special
symbols (if signalled by respective flags) always take precedence, upon RF
transmit initialization ‘preamble’ and ‘header’ flags are set, so transmission
starts with preamble followed by header and data.
Tail is defined as Manchester violation during two successive bits (logic 0 or
logic 1 during two bits time). Within this application, the data transmission is
simply stopped (creating logic 0 effectively). When all data are sent, the tail flag
is set. During the next interrupt (after the last data bit is really sent out), the ‘tail’
flag is cleared, transmit cleanup is done, transmission is finished, and this
condition is signalled to the main loop.
COMPARE
OC ISR = Output Compare Interrupt Service Routine
OUTPUT
OC ISR
TOGGLE ON
OVERFLOW
Figure 14. Manchester Data Encoding Through
Wireless HC08 Modem
ANOTHER ISR TASK
COMPARE
OUTPUT
Output Compare Interrupt
Figure 15
TOGGLE ON
OC ISR
OVERFLOW
Figure
shows the where program control
14, where the second OC ISR is
COMPARE
OUTPUT
OC ISR
TOGGLE ON
OVERFLOW
MOTOROLA
COMPARE
OUTPUT

Related parts for AN2262