This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] AM2754-Q1: What are Slot Bitmasks in McASP Sysconfig?

Part Number: AM2754-Q1
Other Parts Discussed in Thread: SYSCONFIG

While configuring McASP in sysconfig, I came across the mcasp slot bitmask option. What value should I select for this option? What is the use of this option? How the McASP operations change based on the transmit and receive slot bitmask?

  • MCASP Transmit and Receive Slot Bitmasks


    What are Slot Bitmasks?

    Slot bitmasks in MCASP define which time slots in a TDM (Time Division Multiplexing) frame are active for transmitting or receiving data. Each bit in the bitmask corresponds to one time slot.

    Basic Concept:

    TDM Frame = Multiple Time Slots
    Each Slot = One Audio Channel
    Bitmask = Which slots are active (1) or inactive (0)

    Bitmask Structure:

    For a 16-slot TDM frame:

    Bit Position:  15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0

    Time Slot:     15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0

    Bitmask:        1  0  1  0  1  0  1  0  1  0  1  0  1  0  1  0

    - Bit = 1:  Slot is active (data transmitted/received)

    - Bit = 0:  Slot is inactive (no data)

     

      ---

    Examples:

    EXAMPLE 1A: TDM-16 - TX SLOT MASK - SIMPLE 4-CHANNEL TX

     

    Scenario: Use first 4 slots for transmission

     

    TX Slot Mask:0x000F

     

    Binary: 0000 0000 0000 1111

    Active TX Slots: 0, 1, 2, 3

     

    Visual:

    Slots: | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|

    TX:    |TX|TX|TX|TX| -| -| -| -| -| -| -| -| -| -| -| -|

     

    EXAMPLE 1B: TDM-16 - RX SLOT MASK - SIMPLE 4-CHANNEL RX

     

    Scenario: Use slots 4-7 for reception

     

    RX Slot Mask:0x00F0

     

    Binary: 0000 0000 1111 0000

    Active RX Slots: 4, 5, 6, 7

     

    Visual:

    Slots: | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|

    RX:    | -| -| -| -|RX|RX|RX|RX| -| -| -| -| -| -| -| -|

     

    EXAMPLE 2A: TX SLOT MASK - STEREO AUDIO TX

     

    Scenario: Stereo output transmission (2 channels)

     

    TX Slot Mask: 3(or 0x3)

     

    Binary: 11

    Active TX Slots: 0, 1 (Left, Right)

    Bitmask value range: 0-3 (only 2 bits needed)

     

    Possible stereo TX bitmask values:

    - 0(binary: 00) = No slots active

    - 1(binary: 01) = Slot 0 active (Left only)

    - 2(binary: 10) = Slot 1 active (Right only)

    - 3(binary: 11) = Slots 0,1 active (Left + Right)

     

    EXAMPLE 2B: RX SLOT MASK - STEREO AUDIO RX

     

    Scenario: Stereo input reception (2 channels)

     

    RX Slot Mask: 2(or 0x10)

     

    Binary: 10

    Active RX Slots: 1 (Left, Right)

    Bitmask value range: 0-3 (only 2 bits needed)

     

    Possible stereo RX bitmask values:

    - 0(binary: 00) = No slots active

    - 1(binary: 01) = Slot 0 active (Left only)

    - 2(binary: 10) = Slot 1 active (Right only)

    - 3(binary: 11) = Slots 0,1 active (Left + Right)

     

     

    EXAMPLE 3A: TX SLOT MASK - SPARSE CHANNEL TX

     

    Scenario: Non-contiguous slots for transmission

     

    TX Slot Mask: 0xA5A5

     

    Binary: 1010 0101 1010 0101

    Active TX Slots: 0, 2, 5, 7, 8, 10, 13, 15

     

    EXAMPLE 3B: RX SLOT MASK - SPARSE CHANNEL RX

     

    Scenario: Non-contiguous slots for reception

     

    RX Slot Mask: 0x5A5A

     

    Binary: 0101 1010 0101 1010

    Active RX Slots: 1, 3, 4, 6, 9, 11, 12, 14

     

     

    HOW RECEIVE BUFFERS ARE FILLED BASED ON RECEIVE BITMASK

     

    BASIC PROCESS:

     

    When you set a receive bitmask, the MCASP hardware:

    1. Monitors the incoming TDM frame
    2. Captures only the time slots marked as active (bit = 1) in the bitmask
    3. Stores the captured data sequentially in the receive buffer
    4. Ignores inactive slots (bit = 0)

     

    DATA FLOW PROCESS:

     

    Step 1: Incoming TDM Frame

     

    Incoming TDM Frame (16 slots):

    +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

    | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |10 |11 |12 |13 |14 |15 |

    | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P |

    +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

     

    Note: Each slot always contains the same type of data (A=Slot0, B=Slot1, etc.).

    The subscript number indicates the frame number.

     

    Step 2: Bitmask Filtering

    The receive bitmask determines which slots get captured.

     

    Step 3: Buffer Filling

    Active slots are stored sequentially in the receive buffer.

     

    EXAMPLES:

     

    EXAMPLE 1: SIMPLE 4-SLOT RECEPTION

     

    RX Bitmask: 0x000F(slots 0, 1, 2, 3 active)

     

    TDM Frame Structure (Every Frame):

    Slots: | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|

    Data:  | A| B| C| D| E| F| G| H|  I|  J|  K| L| M| N| O| P|

    Active:| Y| Y| Y| Y| N| N| N| N| N| N| N| N| N| N| N| N|

     

    Receive Buffer Content (Multiple Frames):

    Buffer Pos:    [0]   [1]   [2]   [3]   [4]    [5]   [6]   [7]   [8]   [9]   [10]   [11]   [12]   [13]   [14]   [15]   [16]   [17]

    Frame 1:        A1  B1   C1   D1 

    Frame 2:                                    A2  B2   C2   D2 

    Frame 3:                                                                 A3   B3   C3   D3 

    Frame 4:                                                                                                  A4   B4   C4   D4 

    Frame 5:                                                                                                                                      A5    B5

    Source Slot:  0     1     2     3        0     1       2     3     0     1     2     3       0       1      2      3         0       1   

     

    Explanation:

    - A1= Slot 0 data from Frame 1

    - B2= Slot 1 data from Frame 2

    - C3= Slot 2 data from Frame 3, etc.

     

    EXAMPLE 2: NON-CONTIGUOUS SLOTS

     

    RX Bitmask: 0x5050  (slots 4, 6, 12, 14 active)

     

    TDM Frame Structure (Every Frame):

    Slots: | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|

    Data:  | A| B| C| D| E| F| G| H| I| J| K| L| M| N| O| P|

    Active:|N |N | N| N| Y| N| Y|N| N| N| N| N| Y| N| Y| N|

     

    Receive Buffer Content (Multiple Frames):

    Buffer Pos:     [0]  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [9]  [10]  [11]  [12]  [13]  [14]  [15]  [16]  [17]

    Frame 1:        E1 G1 M1 O1 

    Frame 2:                                 E2  G2  M2  O2 

    Frame 3:                                                         E3  G3  M3  O3 

    Frame 4:                                                                                     E4  G4  M4  O4 

    Frame 5:                                                                                                                     E5  G5

    Source Slot:   4   6  12  14       4   6  12  14     4   6  12  14        4   6  12  14              4   6

     

    Explanation:

    - E1= Slot 4 data from Frame 1

    - G2= Slot 6 data from Frame 2

    - M3= Slot 12 data from Frame 3

    - O4= Slot 14 data from Frame 4, etc.