32-Bit-Digital Signal Controller TMS320F2833x
32-Bit-Digital Signal Controller TMS320F2833x
13 - 1
Multi
ultic
channel Buffered Serial Port (McBSP)
Introduction:
• Two High – Speed multichannel synchronous serial ports (McBSP-
A and McBSP-B)
• Maximum data rate: 20 MHz
• Each McBSP consists of a data - flow – path and a control - path
13 - 2
McBSP Block Diagram
CPU
RSR2 RSR1 MDRx
16 16
13 - 3
Features of McBSP
• Full - duplex communication
• Double-buffered transmission and triple-buffered reception,
allowing a continuous data stream
• Independent clocking and framing for reception and transmission
• send interrupts to the CPU and send DMA events to the DMA -
controller
• 128 channels for transmission and reception
• Multichannel selection modes that enable or disable block
transfers in each of the channels
• Direct interface to industry-standard CODECs, analog interface
chips (AICs), and other serially connected A/D and D/A devices
• Support for external generation of clock signals and frame -
synchronization signals
• A programmable sample rate generator for internal generation and
control of clock signals and frame - synchronization signals
13 - 4
Features of McBSP
• Direct interface to:
• T1/E1 framers
• IOM-2 compliant devices
• AC97-compliant devices with multiphase
frame capability
• I2S compliant devices
• SPI devices
• Variable data sizes: 8, 12, 16, 20, 24, and 32 bits
• A-law (Europe) and µ-law (US & Japan)
hardware compression / expanding
13 - 5
Definition: Word and Frame
FS
D w6 w7 w0 w1 w2 w3 w4 w5 w6 w7
Frame
Word
13 - 6
Definition: Bit and Word
CLK
FS
D a1 a0 b7 b6 b5 b4 b3 b2 b1 b0
Word
Bit
13 - 7
Multi--Channel Selection
Multi
Ch0-0
Multi-channel
Frame TDM Bit Stream Ch0-1
M Transmit
C 0 Ch31 ... Ch1 Ch0
c &
O Ch5-0
D ... B Receive
1 Ch31 Ch1 Ch0 Ch5-1
E S only selected
C P Channels Ch27-0
Ch27-1
u Allows multiple channels (words) to be independently selected for transmit
and receive (e.g. only enable Ch0, 5, 27 for receive, then process via CPU)
u The McBSP keeps time sync with all channels, but only “listens” or “talks”
if the specific channel is enabled (reduces processing/bus overhead)
13 - 9
McBSP - Clocking
13 - 10
McBSP – Frame Phases
Single Phase Frame, 8 bits per word
13 - 14
McBSP – Register Set
McBSP Control & Data Registers:
Register Description
DRR2 Data Receive Register 2 (high)
DRR1 Data Receive Register 1 (low)
DXR2 Data Transmit Register 2 (high)
DXR1 Data Receive Register 1 (low)
SPCR2 Serial Port Control Register 2
SPCR1 Serial Port Control Register 1
RCR2 Receive Control Register 2
RCR1 Receive Control Register 1
XCR2 Transmit Control Register 2
XCR1 Transmit Control Register 1
SRGR2 Sample Rate Generator Register 2
SRGR1 Sample Rate Generator Register 1
13 - 15
McBSP – Register Set
McBSP Multi Channel Control Registers:
Register Description
MCR2 Multichannel Control Register 2
MCR1 Multichannel Control Register 1
RCERx Receive Channel Enable Register Partition x
XCERx Transmit Channel Enable Register Partition x
PCR Pin Control Register
XCERB Transmit Channel Enable Register Partition B
PCR Pin Control Register Partition Channels
MFFINT Interrupt Enable Register A 0 -15
B 16 – 31
x = Partition A, B, C, D, E, F, G, H C 32 – 47
D 48 – 63
E 64 – 79
F 80 – 95
G 96 – 111
H 112 - 127
13 - 16
McBSP – Data Register
McBSP Data Receive Register (DRR2 and DRR1):
13 - 17
McBSP – Serial Port Control Register (SPCR1)
FRST: Frame Sync Logic Reset 0 = Reset; 1 = release Frame Logic from Reset
GRST: Sample Rate Generator Reset 0 = Reset; 1 = release SRG from Reset
XINTM: Transmit Interrupt Mode 0 = INT when XRDY = 1
1 = INT after 16 channels (multichannel mode)
2 = INT of frame sync pulse
3 = INT on Transmit Frame Sync Error
XSYNCERR: Receive Frame Sync Error 0 = no error; 1 = error
XEMPTY: Transmitter Empty Status bit 0 = Transmitter empty (DXR1); 1 = not empty
XRDY: Transmitter Ready Status bit 1 = Transmitter ready (DXR1,2) to accept new data
XRST: Transmitter Reset Control Bit 0=Reset Transmitter; 1=release Transmitter from Reset
13 - 19
McBSP – Receive Control Register 1 (RCR1)
13 - 20
McBSP – Receive Control Register 2 (RCR2)
13 - 22
McBSP – Transmit Control Register 2 (XCR2)
FSXM: Transmit Frame Sync Mode 0 = Frame Pulse is supplied externally via pin FSX
1 = Frame Pulse generated internally by Sample Rate
Generator (bit FSGM of register SRGR2)
FSRM: Receive Frame Sync Mode 0 = Frame Pulse is supplied externally via pin FSR
1 = Frame Pulse generated internally by Sample Rate
Generator (bit FSGM of register SRGR2)
CLKXM: Transmit Clock Mode if CLKSTP = 0 or 1:
0 = external transmit clock from pin MCLKX
1 = internal transmit clock; MCLKX is output
if CLKSTP = 2 or 3:
0 = McBSP is slave in SPI – Protocol; MCLKX is input
1 = McBSP is master in SPI – Mode; MCLKX is output
SCLKME: Sample Rate Generator Input Mode (see CLKSM in Register SRGR2)
DXSTAT: DX pin Status Bit 1 = drive DX pin high; 0 = DX pin low (GPIO mode)
DRSTAT: DR pin Status Bit 1 = drive DR pin high; 0 = DR pin low (GPIO mode)
FSXP: Transmit Frame Sync Polarity 0 = active high; 1 = active low
FSRP: Receive Frame Sync Polarity 0 = active high; 1 = active low
CLKXP: Transmit Clock Polarity data valid on rising (0) or falling (1) edge of CLKX
CLKRP: Receive Clock Polarity data sampled on rising (1) or falling (0) edge 13 - 26
McBSP – Interrupt Enable Register (MFFINT)
13 - 27
Stereo Audio Codec TLV320AIC23B
Main Features:
Signals:
RHPOUT =
right headphone out
LHPOUT =
left headphone out
13 - 29
Stereo Audio Codec TLV320AIC23B
GPIO -MUX F2833x – Function Description AIC23–
signal
GPIO20 = 2 McBSPA – MDXA Audio data out DIN
GPIO21 = 2 McBSPA – MDRA Audio data in DOUT
GPIO22 = 2 McBSPA – MCLKXA Transmit clock BCLK
13 - 33
Stereo Audio Codec TLV320AIC23B
Digital Audio Path Control Register:
13 - 34
Stereo Audio Codec TLV320AIC23B
Digital Audio Interface Format Register:
13 - 35
Stereo Audio Codec TLV320AIC23B
Sample Rate Control Register:
13 - 37
AIC23B Exercises:
Lab13_1:
• Initialize SPI-A as control channel for AIC23B
• Initialize McBSP-A as data channel for AIC23B
• AIC23B is master and sends the 12MHz base clock
• AIC23B sends a 44.1 kHz frame sync signal to McBSP
• Send a sinusoidal signal, based on the BOOT-ROM
look-up table to the DAC of the AIC23B; sample rate is
44.1 kHz
Lab13_2:
• Send two different signals to left and right audio channel
• Add volume control
Lab13_3:
• Improvement of Lab13_2; reduce Interrupt Service time
13 - 38
EEPROM AT25256 Exercise:
Lab13_4:
• Initialize McBSP-B in SPI-Mode for AT25256
• Write data to EEPROM, if button PB1 (GPIO17) is
pushed. Read the current value from Hex-Encoder
(GPIO12…15) and store it into EEPROM-address
0x0040, bits 3…0.
• Read data from EEPROM-address 0x0040, when button
PB2 (GPIO48) is pushed and display bits 2…0 at LEDs
LD4 (GPOI49), LD3 (GPIO34) and LD1 (GPIO9).
13 - 39
EEPROM AT25256
Timing Diagram:
13 - 40
EEPROM AT25256
Access Status Register:
7 6 5 4 3 2 1 0
WPEN 0 0 0 BP1 BP0 WEN /RDY
13 - 42
EEPROM AT25256
Write – Enable (WREN) Timing:
13 - 43
EEPROM AT25256
Read Status Register (RDSR) Timing:
13 - 44
EEPROM AT25256
Read (READ) Timing:
13 - 45
EEPROM AT25256
Write (WRITE) Timing:
13 - 46