Circc - Consumer Infrared Communications Controller: Author: Tom Tse Microchip Technology Inc
Circc - Consumer Infrared Communications Controller: Author: Tom Tse Microchip Technology Inc
INTRODUCTION
This document describes the Consumer Infrared Communications Controller (CIrCC) function, which is common to a
number of Microchip products. The CIrCC consists of two main architectural blocks: the ACE 16C550A UART and a
Synchronous Communications Engine (SCE). Each Block is supported by its own unique register set.
The CIrCC UART-driven IrDA SIR and SHARP ASK modes are backward-compatible with early Microchip Super I/O
and Ultra I/O infrared implementations. The CIrCC SCE supports IrDA version 1.0 and consumer IR modes. All of the
SCE modes use DMA. The CIrCC offers flexible signal routing and programmable output control through the Raw mode
interface, General Purpose Data pins and Output Multiplexer. Hardware decoding of the NEC PPM Consumer IR
Remote Control format is implemented in the CIrCC. The CIrCC provides a PME output signal that is used to indicate
the occurrence of a valid CIR Wake-up event. Chip-level address decoding is required to access the CIrCC register sets.
Sections
Section 1.0, "Interface Description," on page 3
Section 2.0, "Operation Modes," on page 7
Section 3.0, "Registers," on page 16
Section 4.0, "ACE UART," on page 28
Section 5.0, "SCE," on page 42
Section 6.0, "Bus Interface I/O," on page 44
Section 7.0, "Output Multiplexer," on page 52
Section 8.0, "Chip-Level CIrCC Addressing Support," on page 54
Section 9.0, "AC Timing," on page 55
Features
• Multi-Protocol Serial Communications Controller
• Full IrDA v1.0 Implementation: 2.4 kbps to 115.2 kbps
• Consumer Infrared Remote Control Interface
• SHARP Amplitude Shift Keyed Infrared (ASK IR) Interface
• Direct Rx/Tx Infrared Diode Control (Raw) and General Purpose Data Pins
• Programmable High-Speed Synchronous Communications Engine (SCE) with a 32-Byte FIFO and Programmable
Threshold
• Programmable DMA Refresh Counter
• High-Speed NS16C550A-Compatible Universal Asynchronous Receiver/ Transmitter Interface (ACE UART) with
16-Byte Send and Receive FIFOs
• ISA Single-Byte and Burst-Mode DMA and Interrupt-Driven Programmed I/O with Zero Wait State and String Move
Timing
• Automatic Transceiver Control
• Transmit Pulse Width Limiter
• SCE Transmit Delay Timer
• IR Media Busy Indicator
Encoders
Raw
REGISTERS ACE SCE IR IR
UART Transducer
Consumer
Module
IR Output
Mux
ASK
IR
IrDA COM
Bus Interface Clock Generator
I/O IR
COMM AUX
Port
Infrared Communications Controller
System Controls
Controls
nACE ACE
Bus Interface Registers
COM
ISA Controls IR
Databus IrDA SIR
Data (0-7) ACE UART
MUX
Sharp ASK COM
Address (0-2)
Output
MUX AUX
FIFO,
DMA, I/O, SCE Consumer
Interrupts G.P.
SCE Raw
nSCE Registers
1.1 Ports
The three Ports (IR, COM, and AUX) provide external access for serial data and controls. The active CIrCC encoder is
routed through the Output Multiplexer to the IR, COM, or AUX port.
1.1.1 DMAEN
DMAEN is used by the chip-level interface to tristate the CIrCC DRQ output when the DMA Enable bit is inactive. The
DMA Enable bit is located in SCE Configuration Register B, bit 0.
1.1.2 IRQEN
IRQEN is used by the chip-level interface to tristate the CIrCC IRQ output when the OUT2 bit is inactive. The OUT2 bit
is located in 16C550A MODEM Control Register.
Note: Power Down only forces the SCE into low power mode. The ACE power down function is not a part of this
application note.
1.1.4 CIR_PME
CIR_PME is used by a chip-level interface to indicate that a valid NEC control frame has been received and a PME
Wake event can be issued. (See the PME WAKE bit in the Consumer IR Control Register in SCE Register Block Two).
1.2.4 TX POLARITY
Typically part of a 16C550A Serial Port Option Register. The value also appears in CIrCC Register Block One, Address
Zero.
1.2.5 RX POLARITY
Typically part of a 16C550A Serial Port Option Register. The value also appears in CIrCC Register Block One, Address
Zero.
1.2.8 IR MODE
Typically part of a 16C550A Serial Port Option Register. These values are also part of the CIrCC Block Control bits 3-
5, Register Block One, Address Zero.
Note: These legacy controls are uniformly updated in the CIrCC and the Top-Level Device Configuration Regis-
ters only when either set of registers is explicitly written using IOW or following a device-level POR. CIrCC
software resets will not affect the legacy bits.
2.1 Raw IR
In Raw mode the state of the IR emitter and detector can be directly accessed through the host interface (Figure 3).
The IR emitter tracks the Raw Tx Control bit in SCE Line Control Register A. For example, depending on the state of
the Tx Polarity control a logic '1' may turn the LED on and a logic '0' may turn the LED off. Care must be taken in software
to ensure that the LED is not on continuously.
The Raw Rx Control bit in SCE Line Control Register A represents the state of the PIN diode. For example, depending
on the state of the Rx Polarity control a logic '1' may mean no IR is detected, a logic '0' may mean IR is being detected.
If an IR carrier is present, the Raw Rx Control bit will oscillate at the carrier frequency.
If enabled, a Raw Mode Interrupt will occur when the Raw Rx Control bit transitions to the active state, depending on
the state of the Rx Polarity control. Raw Mode is enabled with the Block Control Bits in SCE Configuration Register A
(see SCE Configuration Register A (Address 0) on page 22).
Encoder/Decoder
RAW Tx
Registers RAW Rx
Enable Transition
Detect
Interrupt
2.2.2.1 General
The CIrCC implements hardware-level decoding for the NEC Consumer IR Remote Control format. The hardware
decoder may be used to generate a wake-up event or to send parts of the received message frame to the FIFO. The
No Care Custom Code (NCCC), No Care Data Code (NCDC), PME Wake and Frame bits of the Consumer IR Control
register configure the hardware decoder.
Note: The CIrCC hardware can decode NEC protocol framing (sync pulse, 32 bit PPM message data) at any car-
rier frequency or data rate, depending on the programmed Carrier Frequency Divider (CFD) and Bit Rate
Divider (BRD).
Encoder/Decoder Tx Enable
Programmable
Receive Bit-Rate CIR Rx
Receive Carrier
Divider
Sense
Rx Enable Sync
Range
C C C C C C C C C’ C’ C’ C’ C’ C’ C’ C’ D D D D D D D D D’ D’ D’ D’ D’ D’ D’ D’
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
1 .1 2 5 m s
.5 6 2 5 m s
9m s 4 .5 m s 2 .2 5 m s
0 1
8 .7 7 u s
3 8 K H z C a r r ie r
2 6 .3 u s ( 9 m s o r .5 6 2 5 m s )
0 0 10%
0 1 20%
1 0 40%
1 1 Reserved
1 0 1
SCE Tx Data
Transmitter
Light
TV Tx Output No Light
Tx Polarity bit = 1 (default) 1/Carrier
TV Rx Input No Light
Receiver Light
SCE Rx Data
Driver
Rx Polarity bit = 0 (default) 1/Bit Rate
Clock 1 2 3 4 5 6 7 8 9 10
Sync Sync
IR Rx Data
NRZ Rx Data 1 1 0 0 0 1 1 1 0
(SYNC)
Clock 1 2 3 4 5 6 7 8 9 10 11
IR Rx Data
NRZ Rx Data 1 1 0 0 0 1 1 1 1 0
(No SYNC)
Note: The IR Half Duplex Timeout is disabled in hardware when the CIR decoder is configured for wake-up.
DATA 0 0 0 0 0
1 1 1 1 1 1
t2
t1 t2 t1
IRRX
nIRRX
Note 1: IrDA @ 115k is HPSIR compatible. IrDA @ 2400 will allow compatibility with HP95LX and 48SX.
2: IRRX: Rx Polarity bit = 1
nIRRX: Rx Polarity bit = 0 (default)
DATA 0 0 0 0 0
1 1 1 1 1 1
t2
t1 t2 t1
IRTX
nIRTX
DATA
0 1 0 1 0 0 1 1 0 1 1
t1 t2
IRTX
nIRTX
t3 t4
MIRTX
t5 t6
nMIRTX
DATA 0 1 0 1 0 0 1 1 0 1 1
t1 t2
IRRX
nIRRX
t3 t4
MIRRX
t5 t6
nMIRRX
1 3 RO FIFO COUNT
1 6 R/W SCE Configuration C
2 0 R/W Consumer IR Control
2 1 R/W Consumer IR Carrier Rate
2 2 R/W Consumer IR Bit Rate
2 3 R/W Custom Code
2 4 R/W Custom Code
2 5 R/W Data Code
3 0 RO MCHP ID (high)
3 1 RO MCHP ID (low)
3 2 RO CHIP ID
3 3 RO VERSION Number
3 4 RO IRQ Level DMA Channel
3 5 RO Software Select A
3 6 RO Software Select B
Note: The Legacy bits (Register Block One, Address Zero, Bits D0-D6) and the IR Half Duplex Timeout are unaf-
fected by Master Reset.
PROGRAMMER’S NOTE: The IR Busy bit may be unintentionally activated during IR Mode changes.
Note: The SCE Modes bits must be zero for loopback tests.
nActive Frame
0 0 0
0 1 1
1 0 1
1 1 0
D1 D0 Preload Value
0 0 4
0 1 8
1 0 16
1 1 32 (default)
A2 A1 A0 D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 R/W Consumer IR Remote Control Register '00'hex
sync frame pme nccc ncdc carrier carrier range
bit wake off bits
0 0 1 R/W Consumer IR Carrier Rate Register '29'hex
0 1 0 R/W Consumer IR Bit Rate Register '37'hex
0 1 1 R/W Custom Code '00'hex
1 0 0 R/W Custom Code’ '00'hex
1 0 1 R/W Data Code '00'hex
1 1 0 Reserved
Note: The NCDC bit has no effect if either the Frame bit or the PME Wake bit is inactive (zero).
A2 A1 A0 D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 RO MCHP ID (high-byte) '10'hex
0 0 1 RO MCHP ID (low-byte) 'B8'hex
0 1 0 RO CHIP ID 'FA'hex
0 1 1 RO VERSION Number '00'hex
1 0 0 RO IRQ Level DMA Channel Note 1
1 0 1 RO Software Select A Note 1
1 1 0 RO Software Select B Note 1
Note 1: The default values for these registers assume the values that have been programmed in chip-level config-
uration registers.
This register holds the received incoming data byte. Bit 0 is the least significant bit, which is transmitted and received
first. Received data is double buffered; this uses an additional shift register to receive the serial data stream and convert
it to a parallel 8 bit word which is transferred to the Receive Buffer register. The shift register is not accessible.
This register contains the data byte to be transmitted. The transmit buffer is double buffered, utilizing an additional shift
register (not accessible) to convert the 8 bit data word to a serial format. This shift register is loaded from the Transmit
Buffer when the transmission of the previous byte is complete.
The lower four bits of this register control the enables of the five interrupt sources of the Serial Port interrupt. It is possible
to totally disable the interrupt system by resetting bits 0 through 3 of this register. Similarly, setting the appropriate bits
of this register to a high, selected interrupts can be enabled. Disabling the interrupt system inhibits the Interrupt Identi-
fication Register and disables any Serial Port interrupt out of the Microchip CIrCC. All other system functions operate in
their normal manner, including the Line Status and MODEM Status Registers. The contents of the Interrupt Enable Reg-
ister are described below.
Bit 0
This bit enables the Received Data Available Interrupt (and timeout interrupts in the FIFO mode) when set to logic "1".
Bit 1
This bit enables the Transmitter Holding Register Empty Interrupt when set to logic "1".
Bit 2
This bit enables the Received Line Status Interrupt when set to logic "1". The error sources causing the interrupt are
Overrun, Parity, Framing and Break. The Line Status Register must be read to determine the source.
Bit 3
This bit enables the MODEM Status Interrupt when set to logic "1". This is caused when one of the Modem Status
Register bits changes state.
Bits 4 through 7
These bits are always logic "0".
This is a write only register at the same location as the IIR. This register is used to enable and clear the FIFOs, set the
RCVR FIFO trigger level.
Bit 0
Setting this bit to a logic "1" enables both the XMIT and RCVR FIFOs. Clearing this bit to a logic "0" disables both the
XMIT and RCVR FIFOs and clears all bytes from both FIFOs. When changing from FIFO Mode to non-FIFO (16450)
mode, data is automatically cleared from the FIFOs. This bit must be a 1 when other bits in this register are written to
or they will not be properly programmed.
Bit 1
Setting this bit to a logic "1" clears all bytes in the RCVR FIFO and resets its counter logic to 0. The shift register is not
cleared. This bit is self-clearing.
Bit 2
Setting this bit to a logic "1" clears all bytes in the XMIT FIFO and resets its counter logic to 0. The shift register is not
cleared. This bit is self-clearing.
Bit 3
Writing to this bit has no effect on the operation of the UART. The RXRDY and TXRDY pins are not available on this chip.
0 0 1
0 1 4
1 0 8
1 1 14
Bit 6,7
These bits are used to set the trigger level for the RCVR FIFO interrupt.
By accessing this register, the host CPU can determine the highest priority interrupt and its source. Four levels of priority
interrupt exist. They are in descending order of priority:
1. Receiver Line Status (highest priority)
2. Received Data Ready
3. Transmitter Holding Register Empty
4. MODEM Status (lowest priority)
Information indicating that a prioritized interrupt is pending and the source of that interrupt is stored in the Interrupt Iden-
tification Register (refer to Table 25, "Interrupt Control"). When the CPU accesses the IIR, the Serial Port freezes all
interrupts and indicates the highest priority pending interrupt to the CPU. During this CPU access, even if the Serial Port
records new interrupts, the current indication does not change until access is completed. The contents of the IIR are
described below.
Bit 0
This bit can be used in either a hardwired prioritized or polled environment to indicate whether an interrupt is pending.
When bit 0 is a logic "0", an interrupt is pending and the contents of the IIR may be used as a pointer to the appropriate
internal service routine. When bit 0 is logic "1", no interrupt is pending.
Bits 1 and 2
These two bits of the IIR are used to identify the highest priority interrupt pending as indicated by the Interrupt Control
Table.
Bit 3
In non-FIFO mode, this bit is a logic "0". In FIFO mode this bit is set along with bit 2 when a timeout interrupt is pending.
Bits 4 and 5
These bits of the IIR are always logic "0".
Bits 6 and 7
These two bits are set when the FIFO CONTROL Register bit 0 equals 1.
Interrupt Reset
Bit 3 Bit 2 Bit 1 Bit 0 Priority Level Interrupt Type Interrupt Source
Control
0 0 0 1 - None None -
0 1 1 0 Highest Receiver Line Overrun Error, Reading the
Status Parity Error, Line Status
Framing Error or Register
Break Interrupt
0 1 0 0 Second Received Data Receiver Data Read Receiver
Available Available Buffer or the
FIFO drops
below the
trigger level.
1 1 0 0 Second Character Timeout No Characters Reading the
Indication Have Been Receiver Buffer
Removed From or Register
Input to the RCVR
FIFO during the
last 4 Char times
and there is at
least 1 char in it
during this time
0 0 1 0 Third Transmitter Holding Transmitter Reading the IIR
Register Empty Holding Register Register (if
Empty Source of
Interrupt) or
Writing the
Transmitter
Holding
Register
0 0 0 0 Fourth MODEM Status Clear to Send or Reading the
Data Set Ready or MODEM Status
Ring Indicator or Register
Data Carrier
Detect
Bits 0 and 1
These two bits specify the number of bits in each transmitted or received serial character. The encoding of bits 0 and 1
is as follows:
The Start, Stop and Parity bits are not included in the word length.
Bit 2
This bit specifies the number of stop bits in each transmitted or received serial character. The following table summa-
rizes the information.
0 -- 1
1 5 bits 1.5
1 6 bits 2
1 7 bits 2
1 8 bits 2
Note: The receiver will ignore all stop bits beyond the first, regardless of the number used in transmitting.
Bit 3
Parity Enable bit. When bit 3 is a logic "1", a parity bit is generated (transmit data) or checked (receive data) between
the last data word bit and the first stop bit of the serial data. (The parity bit is used to generate an even or odd number
of 1s when the data word bits and the parity bit are summed).
Bit 4
Even Parity Select bit. When bit 3 is a logic "1" and bit 4 is a logic "0", an odd number of logic "1"'s is transmitted or
checked in the data word bits and the parity bit. When bit 3 is a logic "1" and bit 4 is a logic "1" an even number of bits
is transmitted and checked.
Bit 5
Stick Parity bit. When bit 3 is a logic "1" and bit 5 is a logic "1", the parity bit is transmitted and then detected by the
receiver in the opposite state indicated by bit 4.
Bit 6
Set Break Control bit. When bit 6 is a logic "1", the transmit data output (TXD) is forced to the Spacing or logic "0" state
and remains there (until reset by a low level bit 6) regardless of other transmitter activity. This feature enables the Serial
Port to alert a terminal in a communications system.
Bit 7
Divisor Latch Access bit (DLAB). It must be set high (logic "1") to access the Divisor Latches of the Baud Rate Generator
during read or write operations. It must be set low (logic "0") to access the Receiver Buffer Register, the Transmitter
Holding Register, or the Interrupt Enable Register.
This 8 bit register controls the interface with the MODEM or data set (or device emulating a MODEM). The contents of
the MODEM control register are described below.
Bit 0
This bit controls the Data Terminal Ready (nDTR) output. When bit 0 is set to a logic "1", the nDTR output is forced to
a logic "0". When bit 0 is a logic "0", the nDTR output is forced to a logic "1".
Bit 1
This bit controls the Request To Send (nRTS) output. Bit 1 affects the nRTS output in a manner identical to that
described above for bit 0.
Bit 2
This bit controls the Output 1 (OUT1) bit. This bit does not have an output pin and can only be read or written by the CPU.
Bit 3
Output 2 (OUT2). This bit is used to enable an UART interrupt. When OUT2 is a logic "0", the serial port interrupt output
is forced to a high impedance state - disabled. When OUT2 is a logic "1", the serial port interrupt outputs are enabled.
Bit 4
This bit provides the loopback feature for diagnostic testing of the Serial Port. When bit 4 is set to logic "1", the following
occur:
This feature allows the processor to verify the transmit and receive data paths of the Serial Port.
In the diagnostic mode, the receiver and the transmitter interrupts are fully operational. The MODEM Control Interrupts
are also operational but the interrupts' sources are now the lower four bits of the MODEM Control Register instead of
the MODEM Control inputs. The interrupts are still controlled by the Interrupt Enable Register.
Bits 5 through 7
These bits are permanently set to logic zero.
Bit 0
Data Ready (DR). It is set to a logic "1" whenever a complete incoming character has been received and transferred
into the Receiver Buffer Register or the FIFO. Bit 0 is reset to a logic "0" by reading all of the data in the Receive Buffer
Register or the FIFO.
Bit 1
Overrun Error (OE). Bit 1 indicates that data in the Receiver Buffer Register was not read before the next character was
transferred into the register, thereby destroying the previous character. In FIFO mode, an overrun error will occur only
when the FIFO is full and the next character has been completely received in the shift register, the character in the shift
register is overwritten but not transferred to the FIFO. The OE indicator is set to a logic "1" immediately upon detection
of an overrun condition, and reset whenever the Line Status Register is read.
Bit 2
Parity Error (PE). Bit 2 indicates that the received data character does not have the correct even or odd parity, as
selected by the even parity select bit. The PE is set to a logic "1" upon detection of a parity error and is reset to a logic
"0" whenever the Line Status Register is read. In the FIFO mode this error is associated with the particular character in
the FIFO it applies to. This error is indicated when the associated character is at the top of the FIFO.
Bit 3
Framing Error (FE). Bit 3 indicates that the received character did not have a valid stop bit. Bit 3 is set to a logic "1"
whenever the stop bit following the last data bit or parity bit is detected as a zero bit (Spacing level). The FE is reset to
a logic "0" whenever the Line Status Register is read. In the FIFO mode this error is associated with the particular char-
acter in the FIFO it applies to. This error is indicated when the associated character is at the top of the FIFO. The Serial
Port will try to resynchronize after a framing error. To do this, it assumes that the framing error was due to the next start
bit, so it samples this 'start' bit twice and then takes in the 'data'.
Bit 4
Break Interrupt (BI). Bit 4 is set to a logic "1" whenever the received data input is held in the Spacing state (logic "0") for
longer than a full word transmission time (that is, the total time of the start bit + data bits + parity bits + stop bits). The
BI is reset after the CPU reads the contents of the Line Status Register. In the FIFO mode this error is associated with
the particular character in the FIFO it applies to. This error is indicated when the associated character is at the top of
the FIFO. When break occurs only one zero character is loaded into the FIFO. Restarting after a break is received,
requires the serial data (RXD) to be logic "1" for at least 1/2 bit time.
Note: Bits 1 through 4 are the error conditions that produce a Receiver Line Status Interrupt whenever any of the
corresponding conditions are detected and the interrupt is enabled.
Bit 5
Transmitter Holding Register Empty (THRE). Bit 5 indicates that the Serial Port is ready to accept a new character for
transmission. In addition, this bit causes the Serial Port to issue an interrupt when the Transmitter Holding Register inter-
rupt enable is set high. The THRE bit is set to a logic "1" when a character is transferred from the Transmitter Holding
Register into the Transmitter Shift Register. The bit is reset to logic "0" whenever the CPU loads the Transmitter Holding
Register. In the FIFO mode this bit is set when the XMIT FIFO is empty, it is cleared when at least 1 byte is written to
the XMIT FIFO. Bit 5 is a read only bit.
Bit 6
Transmitter Empty (TEMT). Bit 6 is set to a logic "1" whenever the Transmitter Holding Register (THR) and Transmitter
Shift Register (TSR) are both empty. It is reset to logic "0" whenever either the THR or TSR contains a data character.
Bit 6 is a read only bit. In the FIFO mode this bit is set whenever the THR and TSR are both empty,
Bit 7
This bit is permanently set to logic "0" in the 450 mode. In the FIFO mode, this bit is set to a logic "1" when there is at
least one parity error, framing error or break indication in the FIFO. This bit is cleared when the LSR is read if there are
no subsequent errors in the FIFO.
This 8 bit register provides the current state of the control lines from the MODEM (or peripheral device). In addition to
this current state information, four bits of the MODEM Status Register (MSR) provide change information. These bits
are set to logic "1" whenever a control input from the MODEM changes state. They are reset to logic "0" whenever the
MODEM Status Register is read.
Bit 0
Delta Clear To Send (DCTS). Bit 0 indicates that the nCTS input to the chip has changed state since the last time the
MSR was read.
Bit 1
Delta Data Set Ready (DDSR). Bit 1 indicates that the nDSR input has changed state since the last time the MSR was
read.
Bit 2
Trailing Edge of Ring Indicator (TERI). Bit 2 indicates that the nRI input has changed from logic "0" to logic "1".
Bit 3
Delta Data Carrier Detect (DDCD). Bit 3 indicates that the nDCD input to the chip has changed state.
Note: Whenever bit 0, 1, 2, or 3 is set to a logic "1", a MODEM Status Interrupt is generated.
Bit 4
This bit is the complement of the Clear To Send (nCTS) input. If bit 4 of the MCR is set to logic "1", this bit is equivalent
to nRTS in the MCR.
Bit 5
This bit is the complement of the Data Set Ready (nDSR) input. If bit 4 of the MCR is set to logic "1", this bit is equivalent
to DTR in the MCR.
Bit 6
This bit is the complement of the Ring Indicator (nRI) input. If bit 4 of the MCR is set to logic "1", this bit is equivalent
to OUT1 in the MCR.
Bit 7
This bit is the complement of the Data Carrier Detect (nDCD) input. If bit 4 of the MCR is set to logic "1", this bit is equiv-
alent to OUT2 in the MCR.
This 8 bit read/write register has no effect on the operation of the Serial Port. It is intended as a scratchpad register to
be used by the programmer to hold data temporarily.
4.2 Programmable Baud Rate Generator (and Divisor Latches DLH, DLL)
The Serial Port contains a programmable Baud Rate Generator that is capable of taking any clock input (DC to 3 MHz)
and dividing it by any divisor from 1 to 65535. This output frequency of the Baud Rate Generator is 16x the Baud rate.
Two 8 bit latches store the divisor in 16 bit binary format. These Divisor Latches must be loaded during initialization in
order to insure desired operation of the Baud Rate Generator. Upon loading either of the Divisor Latches, a 16 bit Baud
counter is immediately loaded. This prevents long counts on initial load. If a 0 is loaded into the BRG registers the output
divides the clock by the number 3. If a 1 is loaded the output is the inverse of the input oscillator. If a two is loaded the
output is a divide by 2 signal with a 50% duty cycle. If a 3 or greater is loaded the output is low for 2 bits and high for
the remainder of the count. The input clock to the BRG is the 24 MHz crystal divided by 13, giving a 1.8462 MHz clock.
Table 26 shows the baud rates possible with a 1.8462 MHz crystal.
a) The receive data available interrupt will be issued when the FIFO has reached its programmed trigger level; it is
cleared as soon as the FIFO drops below its programmed trigger level.
b) The IIR receive data available indication also occurs when the FIFO trigger level is reached. It is cleared when
the FIFO drops below the trigger level.
c) The receiver line status interrupt (IIR=06H), has higher priority than the received data available (IIR=04H) inter-
rupt.
d) The data ready bit (LSR bit 0)is set as soon as a character is transferred from the shift register to the RCVR FIFO.
It is reset when the FIFO is empty.
When RCVR FIFO and receiver interrupts are enabled, RCVR FIFO timeout interrupts occur as follows:
a) The transmitter holding register interrupt (02H) occurs when the XMIT FIFO is empty; it is cleared as soon as the
transmitter holding register is written to (1 of 16 characters may be written to the XMIT FIFO while servicing this
interrupt) or the IIR is read.
b) The transmitter FIFO empty indications will be delayed 1 character time minus the last stop bit time whenever
the following occurs: THRE=1 and there have not been at least two bytes at the same time in the transmitter FIFO
since the last THRE=1. The transmitter interrupt after changing FCR0 will be immediate, if it is enabled.
Character timeout and RCVR FIFO trigger level interrupts have the same priority as the current received data available
interrupt; XMIT FIFO empty has the same priority as the current transmitter holding register empty interrupt.
There is no trigger level reached or timeout condition indicated in the FIFO Polled Mode, however, the RCVR and XMIT
FIFOs are still fully capable of holding characters.
TABLE 26: BAUD RATES USING 1.8462 MHZ CLOCK (24 MHZ/13)
Desired Baud Divisor Used to Generate Percent Error Difference Between UART High
Rate 16X Clock Desired and Actual1 Speed Bit2
50 2304 0.001 X
75 1536 - X
110 1047 - X
134.5 857 0.004 X
150 768 - X
300 384 - X
600 192 - X
1200 96 - X
1800 64 - X
2000 58 0.005 X
2400 48 - X
3600 32 - X
4800 24 - X
7200 16 - X
9600 12 - X
19200 6 - X
38400 3 0.030 X
DLAB = 1
AN2452
ADDR = 1 Divisor Latch (MS) DLM Bit 8 Bit 9 Bit 10 Bit 11 Bit 12 Bit 13 Bit 14 Bit 15
DLAB = 1
4.2.3.1 GENERAL
The RCVR FIFO will hold up to 16 bytes regardless of which trigger level is selected.
nIOW
t1
nRTSx,
nDTRx
t5
IRQx
nCTSx,
nDSRx,
nDCDx
t6
t2 t4
IRQx
nIOW
t3
IRQx
nIOR
nRIx
8 Parallel-to-Serial 1 CIR
Transm it Converter Encoder
Tim ing
Controls &
Control
8 Serial-to-Parallel 1 CIR
Receive Converter Decoder
5.1 Framing
The SCE operates with and without framing, depending on the state of the FRAME bit in the Consumer IR Remote Con-
trol register in SCE Register Block Two. With framing implies that the SCE works with the NEC Consumer IR decoder
so that the required portions of the frame message can be extracted and placed in the 32 byte FIFO. Without framing
implies that the SCE operates simply as a serial-to-parallel converter for the Consumer IR (Remote Control) encoder/
decoder.
5.2.1 TRANSMIT
nActiveFrame goes active as soon as the Consumer IR transmitter starts modulating the SCE data stream. nActive-
Frame becomes inactive as soon as the transmit register is empty.
5.2.2 RECEIVE
When the FRAME bit is zero, nActiveFrame goes active as soon as the Consumer IR receiver detects the first active
bit-time of infrared energy. nActiveFrame becomes inactive whenever the Consumer IR receiver is manually disabled,
a DMA Terminal Count has occurred, or following a FIFO Overrun.
When the FRAME bit is one, nActive Frame goes active as soon as the NEC PPM frame format decoder detects valid
data following the leader code. nActive Frame becomes inactive as soon as the receiver updates the line status register
and signals an End-Of-Message following a FIFO overrun.
Note:
• Bit cells are determined by the SCE CIR Bit Rate Divider register. For example; if the Bit Rate Divider is pro-
grammed for the NEC format shown in Figure 5 when the FRAME bit is “1”, then the Frame Error bit will be set if
carrier is detected for 1.125ms or greater, or if no carrier is detected for 2.25ms or greater.
• It is possible for the FIFO to be empty with the Frame Error bit set at the end of an invalid NEC remote control
message frame because the payload data in messages with framing errors will either be ignored or passed to the
FIFO depending on the data pattern and the frequency of violations.
SCE
Note: The DMA controller will fill the FIFO until the FIFO Threshold has been exceeded before the transmitter is
enabled.
The FIFO Threshold value is programmable from 0 to 31. The FIFO Threshold Register, located in Register Block One,
Address Two, contains the FIFO Threshold value. Low threshold values result in longer periods of time between service
requests because more of the FIFO is utilized before the request is issued. Systems that program low threshold values
must typically provide fast response times to these requests; i.e., high performance systems that move I/O data quickly.
High threshold values are used in "sluggish" systems with long service request latencies. Low performance systems
typically take longer to move I/O data and require more frequent I/O service. For systems that program high FIFO thresh-
old values, much less of the FIFO is utilized before service requests are issued.
AEN
DMA Burst
DMA Enable
DRQ
nDACK
I/Ox
TC
AEN
DMA Burst
DMA Enable
DRQ
nDACK
I/Ox
TC
Disable 32-Clk
Countdown & Reset Enable 32-Clk
32-Clk Counter Countdown
DMA Burst
DMA Enable
DRQ
nDACK
I/Ox
Refresh Interval
32 clocks
max. 350ns
min.
DMA Burst
DMA Enable
DRQ
Refresh Interval
FIFO FULL
Tx Enable
TxServReq
TC
DMA Burst
DMA Enable
Rx Enable
DRQ
Refresh Interval
FIFO NOT EMPTY
TC
AEN
String Move
FIFO Not Empty
IOCHRDY
IOR
String Move
DMA Enable
FIFO NOT EMPTY
IOR
String Move
DMA Enable
FIFO FULL
IOW
6.4.2.1 Transmit
Transmitting messages with Programmed I/O using FIFO Interrupt requires writing a fixed number of data bytes, usually
related to the threshold, whenever the FIFO Interrupt becomes active. An appropriate FIFO Threshold value allows the
host to efficiently satisfy the FIFO service requests until the message transmission is complete. For slow systems, the
FIFO can be manually filled with transmit data before the transmitter is enabled.
Note: The FIFO will automatically request service before the transmitter is activated if the FIFO Threshold is
greater than zero.
String Move
DMA Enable
Tx Enable
IOW
TxServReq
FIFO Int. Enable
FIFO Interrupt
Data Done
EOM Interrupt
6.4.3 RECEIVE
Receiving messages with Programmed I/O using FIFO Interrupt requires reading a fixed number of data bytes, usually
related to the threshold, whenever the FIFO Interrupt becomes active. An appropriate FIFO Threshold value allows the
host to efficiently satisfy the FIFO service requests until the message reception is complete.
String Move
DMA Enable
Rx Enable
IOR
RxServReq
FIFO Int. Enable
FIFO Interrupt
EOM Interrupt
AEN
String Move 10us (max)
FIFO Not Empty
IOCHRDY
IOR
24ns (max)
AEN
String Move
FIFO Not Empty
IOCHRDY
IOR
IOCHRDY Time-out
10us
Start IOCHRDY
Timer Error
6.4.6.1 nSRDY
nSRDY can be driven by the CIrCC to indicate that an access cycle shorter than the standard I/O cycle can be executed.
Note: The names nSRDY & nNOWS can be used interchangeably. nSRDY is enabled by the No Wait bit in SCE
Configuration Register B. When No Wait is one, nSRDY goes active following the trailing edge of the ISA
I/O command and inactive following the rising edge (Figure 29). nSRDY is suppressed during DMA &
refresh cycles, i.e. when AEN is active, or when IOCHRDY is inactive. Zero Wait State support is only avail-
able when the SCE is enabled.
AEN
No Wait
I/Ox
nSRDY
The Interaction of nSRDY and IOCHRDY determine the three types of ISA access cycles: no-wait-state cycle,
standard cycle, ready cycle (Table 29).
Note: An inactive IOCHRDY suppresses nSRDY.
Note: The Tx/Rx Polarity bits do not apply when COM mode is selected.
IRRx IR
Raw Rx 6 to 1 1 to 3 IRTx Port
Raw Tx Mux. Demux.
CIR Rx
CIR Tx ARx AUX
ATx Port
ASK Rx 2 to 1
ASK Tx Mux.
IrDA SIR Rx
IrDA SIR Tx CRx
CTx
1 to 6 3 to 1 nRTS COM
nDTR Port
COM Rx Demux. Mux.
nCTS
COM Tx nDSR
nDCD
nRI
Note: This figure is for illustration purposes only and is not intended to suggest specific implementation details.
APPLICATION NOTE: The Transmit Pulse Width Limit can seriously distort low frequency Consumer IR carriers (
5kHz) or unmodulated low frequency Consumer IR bit rates.
TX PW LIMIT IN
TX PW LIMIT OUT
100us 300us
Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
CIrCCInformation contained in this publication regarding device applications and the like is provided only for your convenience and may
be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES
NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY
OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFOR-
MANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use.
Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify
and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed,
implicitly or otherwise, under any Microchip intellectual property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, AVR, AVR logo, AVR Freaks, BeaconThings, BitCloud, CryptoMemory, CryptoRF,
dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KEELOQ, KEELOQ logo, Kleer, LANCheck, LINK MD, maXStylus, maXTouch, MediaLB, megaAVR,
MOST, MOST logo, MPLAB, OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip Designer, QTouch, RightTouch, SAM-BA, SpyNIC,
SST, SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and
other countries.
ClockWorks, The Embedded Control Solutions Company, EtherSynch, Hyper Speed Control, HyperLight Load, IntelliMOS, mTouch, Precision
Edge, and Quiet-Wire are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom, chipKIT, chipKIT logo, CodeGuard,
CryptoAuthentication, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN,
EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi, MiWi, motorBench,
MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit,
PICtail, PureSilicon, QMatrix, RightTouch logo, REAL ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher,
SuperSwitcher II, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other
countries.
All other trademarks mentioned herein are property of their respective companies.
© 2017, Microchip Technology Incorporated, All Rights Reserved.
ISBN: 9781522417064
QUALITY MANAGEMENT SYSTEM Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
CERTIFIED BY DNV Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
== ISO/TS 16949 ==
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.