ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
16
8
32
16
8
From CPU/DMA
DX
DR
To CPU/DMA
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
DRR
RJUST
DXR
Expand
Compress
RBR
XSR
RSR
Architecture
1224
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Multichannel Buffered Serial Port (McBSP)
25.2.8
μ
-Law/A-Law Companding Hardware Operation
Companding (compressing and expanding) hardware allows compression and expansion of data in either
μ
-law or A-law format. The specification for
μ
-law and A-law log PCM is part of the CCITT G.711
recommendation. The companding standard employed in the United States and Japan is
μ
-law and allows
14 bits of dynamic range. The European companding standard is A-law and allows 13 bits of dynamic
range. Any values outside these ranges are set to the most positive or most negative value. Thus, for
companding to work best here, the data transferred to and from the McBSP via the CPU or the EDMA
controller must be at least 16 bits wide.
The
μ
-law and A-law formats encode data into 8-bit code elements. Companded data is always 8 bits
wide, so the appropriate (R/X)WDLEN1/2 must be cleared to 0, indicating an 8-bit serial data stream. If
companding is enabled and either phase of the frame does not have an 8-bit element length, companding
continues as if the element length is eight bits.
When companding is used, transmit data is encoded according to the specified companding law, and
receive data is decoded to 2s-complement format. Companding is enabled and the desired format is
selected by appropriately setting (R/X)COMPAND in the (R/X)CR. Compression occurs during the process
of copying data from DXR to XSR and expansion occurs from RBR to DRR, as shown in
.
For transmit data to be compressed, it should be 16-bit, left-justified data, such as LAW16, as shown in
. The value can be either 13 or 14 bits wide, depending on the companding law. This 16-bit
data is aligned in DXR, as shown in
.
For reception, the 8-bit compressed data in RBR is expanded to a left-justified 16-bit data, LAW16. This
can be further justified to 32-bit data by programming the RJUST bits in the serial port control register
(SPCR), as shown in
Figure 25-33. Companding Flow
Figure 25-34. Companding Data Formats
LAW16
15
2
1
0
μ
-Law
Value
0
0
LAW16
15
3
2
1
0
A-Law
Value
0
0
0
Figure 25-35. Transmit Data Companding Format in DXR
31
16 15
0
Don't care
LAW16