beautypg.com

Data line controller – Rainbow Electronics AT89C5132 User Manual

Page 91

background image

91

AT8xC5132

4173A–8051–08/02

Data Line Controller

The data line controller is based on a 16-byte FIFO used both by the data transmitter
channel and by the data receiver channel.

Figure 65. Data Line Controller Block Diagram

FIFO Implementation

The 16-byte FIFO is based on a dual 8-byte FIFO managed using two pointers and four
flags indicating the status full and empty of each FIFO.

Pointers are not accessible to user but can be reset at any time by setting and clearing
DRPTR and DTPTR Bits in MMCON0 register. Resetting the pointers is equivalent to
abort the writing or reading of data.

F1EI and F2EI flags in MMINT register signal when set that respectively FIFO1 and
FIFO2 are empty. F1FI and F2FI flags in MMINT register signal when set that respec-
tively FIFO1 and FIFO2 are full. These flags may generate an MMC interrupt request as
detailed in Section “Interrupt”.

Data Configuration

Before sending or receiving any data, the data line controller must be configured accord-
ing to the type of the data transfer considered. This is achieved using the Data Format
bit: DFMT in MMCON0 register. Clearing DFMT bit enables the data stream format
while setting DFMT bit enables the data block format. In data block format, user must
also configure the single or multi-block mode by clearing or setting the MBLOCK bit in
MMCON0 register and the block length using BLEN3:0 Bits in MMCON1 according to
Table 93. Figure 66 summarizes the data modes configuration flows.

Table 93. Block Length Programming

MCBI

MMINT.1

DATFS

MMSTA.3

CRC16S

MMSTA.4

F2FI

MMINT.3

F2EI

MMINT.1

DFMT

MMCON0.2

MBLOCK

MMCON0.3

DATDIR

MMCON1.3

Data Converter

// -> Serial

BLEN3:0

MMCON1.7:4

DATEN

MMCON1.2

DATA Line

Finished State Machine

Data Converter

Serial -> //

DTPTR

MMCON0.6

DRPTR

MMCON0.7

TX Pointer

RX Pointer

8-byte

FIFO 1

8-byte

FIFO 2

16-byte FIFO

MMDAT

F1EI

MMINT.0

CRC16 and Format

Checker

F1FI

MMINT.2

EOFI

MMINT.4

CBUSY

MMSTA.5

CRC16

Generator

MDAT

BLEN3:0

Block Length (Byte)

BLEN = 0000 to 1011

Length = 2

BLEN

: 1 to 2048

> 1011

Reserved: do not program BLEN3:0 > 1011