MAX3140
SPI/MICROWIRE-Compatible UART with Integrated
True Fail-Safe RS-485/RS-422 Transceivers
22 ______________________________________________________________________________________
Baud-Rate Generator
The baud-rate generator determines the rate at which
the transmitter and receiver operate. Bits B3–B0 in the
WRITE CONFIGURATION register determine the baud-
rate divisor (BRD), which divides the X1 oscillator
frequency. The on-board oscillator operates with either
a 1.8432MHz or a 3.6864MHz crystal, or is driven at X1
with a 45% to 55% duty-cycle square wave. Table 6
shows baud-rate divisors for given input codes, as well
as the baud rate for 1.8432MHz and 3.6864MHz crys-
tals. The generator’s clock is 16 times the baud rate.
Interrupt Sources and Masks
Using the READ DATA or WRITE DATA register clears
the interrupt IRQ, assuming the conditions that initiated
the interrupt no longer exist. Table 7 gives the details
for each interrupt source. Figure 15 shows the function-
al diagram for the interrupt sources and mask blocks.
Two examples of setting up an IRQ for the MAX3140
are shown below.
Example 1:
Setting up only the transmit buffer-empty
interrupt.
Send the 16-bit word below into DIN of the MAX3140
using the WRITE CONFIGURATION register. This 16-bit
word configures the MAX3140 for 9600bps, 8-bit words,
no parity, and one stop bit with a 1.8432MHz crystal.
binary 1100100000001010
HEX C80A
Notes:
bit 15, 14: DIN
0, 0 = Read Data
bit 13–0: DIN
Zeros
bit 15: DOUT
R = 1, Data is available to be read from the receive register or
FIFO.
R = 0, Receive register and FIFO are empty.
bit 14: DOUT
T = 1, Transmit buffer is empty.
T = 0, Transmit buffer is full.
bit 13–11: DOUT
Zeros
bit 10: DOUT
RA/FE = Receive-activity (UART shutdown)/Framing-error
(normal operation) bit
bit 9: DOUT
CTS = CTS input state. If CTS = 0, then CTS = 1 and vice versa.
bit 8: DOUT
Pr = Received parity bit. This is only valid if PE = 1.
bit 7–0: DOUT
D7t–D0t = Received Data bits. D7r = 0 for L = 1.
Table 5. READ DATA Register Bit Assignment (D15, D14 = 0, 0)
14
0
T
6
0
D6r
7
0
D7r
15 2
DIN 0 0
DOUT R D2r
BIT 3
0
D3r
0
0
D0r
1
0
D1r
4
0
D4r
5
0
D5r
10
0
RA/FE
11
0
0
8
0
Pr
9
0
CTS
12
0
0
13
0
0
Table 6. Baud-Rate Selection Table*
115.2k
230.4k**
BAUD
RATE
(f
OSC
=
3.6864MHz)
BAUD
B3 B2 B1 B0
20001
10 0 0 0**
DIVISION
RATIO
57.6k
115.2k**
BAUD
RATE
(f
OSC
=
1.8432MHz)
28.8k
57.6k
80011
40010
14.4k
28.8k
7200
14.4k
1800
3600
1280111
640110
900
1800
320101
160100
3600
7200
38.4k
76.8k
9600
19.2k
241011
121010
4800
9600
2400
4800
600
1200
3841111
1921110
300
600
961101
481100
1200
2400
61001
31000
19.2k
38.4k
*Standard baud rates shown in bold
**Default baud rate
MAX3140
SPI/MICROWIRE-Compatible UART with Integrated
True Fail-Safe RS-485/RS-422 Transceivers
______________________________________________________________________________________ 23
IRQ
N
RM MASK
TM MASK
PM MASK
TRANSITION ON RX
SHUTDOWN
RAM MASK
FRAMING ERROR
SHUTDOWN
RAM MASK
R
S
Q
NEW DATA AVAILABLE
DATA READ
TRANSMIT BUFFER EMPTY
DATA READ
PE = 1 AND RECEIVED PARITY BIT = 1
PE = 0 OR RECEIVED PARITY BIT = 0
R
S
Q
R
S
Q
Figure 15. Functional Diagram for Interrupt Sources and Mask Blocks
Table 7. Interrupt Sources and Masks—Bit Descriptions
Transmit buffer is
empty
T
MEANING
WHEN SET
TM
The T bit is set when the transmit buffer is ready to accept data. IRQ is asserted
low if TM = 1 and the transmit buffer becomes empty. This source is cleared on
the rising edge of SCLK‘s 16th pulse when using a READ DATA or WRITE DATA
operation. Although the interrupt is cleared, poll T to determine transmit-buffer
status.
DESCRIPTION
Received parity bit = 1
Transition on RX when
in shutdown; framing
error when not in
shutdown
RA/FE
RAM
This is the RA (RX-transition) bit in shutdown, and the FE (framing-error) bit in
operating mode. RA is set if there has been a transition on RX since entering
shutdown. RA is cleared when the MAX3140 exits shutdown. IRQ is asserted
when RA is set and RAM = 1.
FE is determined solely by the currently received data, and is not stored in FIFO.
The FE bit is set if a zero is received when the first stop bit is expected. FE is
cleared upon receipt of the next properly framed character. IRQ is asserted
when FE is set and RAM = 1.
MASK
BIT
Pr
PM
The Pr bit reflects the value in the word currently in the receive-buffer register
(oldest data available). The Pr bit is set when parity is enabled (PE = 1) and the
received parity bit is 1. The Pr bit is cleared either when parity is not enabled (PE
= 0), or when parity is enabled and the received bit is 0. An interrupt is issued
based on the oldest Pr value in the receiver FIFO. The oldest Pr value is the next
value read by a READ DATA operation.
BIT
NAME
Data availableR
RM
The R bit is set when new data is available to be read or when data is being read
from the receive register/FIFO. FIFO is cleared when all data has been read. An
interrupt is asserted as long as R = 1 and RM = 1.
MAX3140
SPI/MICROWIRE-Compatible UART with Integrated
True Fail-Safe RS-485/RS-422 Transceivers
24 ______________________________________________________________________________________
Example 2:
Setting up only the data-available (or data-
being-read) interrupt.
Send the 16-bit word below into DIN of the MAX3140
using the WRITE CONFIGURATION register. This 16-bit
word configures the MAX3140 for 9600bps, 8-bit
words, no parity, and one stop bit with a 1.8432MHz
crystal.
binary 1100010000001010
HEX C40A
Receive FIFO
The MAX3140 contains a receive FIFO for data received
by the UART to minimize processor overhead. The
receive FIFO is 8 words deep and clears automatically if
it overflows. Shutting down the UART also clears the
receive FIFO. Upon power-up, the receive FIFO is
enabled. To disable the receive FIFO, set the FEN bit
high when writing to the WRITE CONFIGURATION regis-
ter. To check whether the FIFO is enabled or disabled,
read back the FEN bit using the READ CONFIGURA-
TION.
UART Shutdown
In shutdown, the oscillator turns off to reduce power
consumption (I
CCSHDN UART
< 1mA). The UART enters
shutdown in one of two ways: by a software command
(SHDNi bit = 1) or by a hardware command (SHDN =
logic low). The hardware shutdown immediately termi-
nates any transmission in progress. The software shut-
down, requested by setting SHDNi bit = 1, is entered
upon completing the transmission of the data in both
the transmit-shift register and the transmit-buffer regis-
ter. The SHDNo bit is set when the UART enters shut-
down (either hardware or software). The microcontroller
(µC) can monitor the SHDNo bit to determine when all
data has been transmitted, then shut down RS-485
transceivers at that time.
Shutdown clears the receive FIFO, R, RA/FE, D0r–D7r,
Pr, and Pt registers and sets the T bit high.
Configuration bits (RM, TM, PM, RAM, IR, ST, PE, L, B0-
3, and RTS) can be modified when SHDNo = 1 and
CTS can also be read. Even though RA is reset upon
entering shutdown, it goes high when a transition is
detected on the RX pin. This allows the UART to moni-
tor activity on the receiver when in shutdown.
The command to power up (SHDNi = 0) turns on the
oscillator when CS goes high if SHDN = logic high, with
a start-up time of at least 25ms. This is done by writing
to the WRITE CONFIGURATION register, which clears
all registers but RTS and CTS. Since the crystal oscilla-
tor typically requires at least 25ms to start, the first
received characters can be garbled and a framing
error may occur.
RS-485/RS-422 Transceiver
The RS-485/RS-422 transceiver is equipped with
numerous features allowing it to be configured for any
RS-485/RS-422 application. Figure 10 shows the
MAX3140 functional diagram. Included in the RS-
485/RS-422 transceiver function is full- and half-duplex
selectability, true fail-safe circuitry, programmable
slew-rate limiting, receiver input filtering, and phase
control circuitry.
Full Duplex or Half Duplex
The MAX3140 operates in either full- or half-duplex
mode. Drive the H/F pin low, leave it unconnected
(internal pull-down), or connect it to GND for full-duplex
operation or drive it high for half-duplex operation. In
half-duplex mode, the receiver inputs are switched to
the driver outputs, connecting outputs Y and Z to inputs
A and B, respectively. In half-duplex mode, the internal
full-duplex receiver input resistors are still connected to
inputs A and B.
True Fail-Safe Circuitry
The MAX3140 guarantees a logic-high receiver output
when the receiver inputs are shorted or open, or when
they are connected to a terminated transmission line
with all drivers disabled. This is done by setting the
receiver threshold between -50mV and -200mV. If the
differential receiver input voltage (A-B) is greater than
or equal to -50mV, RO is logic high. If A-B is less than
or equal to -200mV, RO is logic low. In the case of a
terminated bus with all transmitters disabled, the
receiver’s differential input voltage is pulled to 0 by the
termination. With the receiver thresholds of the
MAX3140, this results in a logic high with a 50mV mini-
mum noise margin. Unlike previous fail-safe devices,
the -50mV to -200mV threshold complies with the
±200mV EIA/TIA-485 standard.
Programmable Slew-Rate Limiting
The MAX3140 has several programmable operating
modes. Transmitter rise and fall times are programma-
ble at 2500ns, 750ns, or 25ns, resulting in maximum
data rates of 115kbps, 500kbps, or 10Mbps, respec-
tively. To select the desired data rate, drive SRL to one
of three possible states by using a three-state driver, by
connecting it to V
CC
or GND, or by leaving it uncon-
nected. For 115kbps operation, set the three-state
device in high-impedance mode or leave SRL uncon-
nected. For 500kbps operation, drive SRL high or con-
nect it to V
CC
. For 10Mbps operation, drive SRL low or
connect it to GND. SRL can be changed during opera-
tion without interrupting data communications.

MAX3140EEI

Mfr. #:
Manufacturer:
Description:
IC UART SPI RS485/422 28-QSOP
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet