SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
In case of a DIT-mode (S/PDIF protocol ) transmission, while left-aligned Q31 data should be right-rotated to a multiple by 4 positions, no right-rotation is required for a right-aligned Q31 data. Because this is a rotation process, not a shifting process, bit 0 gets shifted back into bit 31 during the process.
The MCASP_XFMT[17-16] XDATDLY bit field must be set to a 0-bit delay (0x0 value).
For left-aligned Q31 data, the following transmit format unit settings process the data into right-aligned data, ready for transmission:
For right-aligned data, the following transmit format unit settings process the data into right-aligned audio data ready for transmission:
The example settings provided in Table 12-309 should be applied to MCASP in cases of DIT-transmitting a Q31 data as a 24-bit, 20-bit and 16-bit left- or right- aligned audio word, respectively. Note that the listed settings let the MCASP TFU preserve the most significant bits and cut only the LSBs of the original Q31 CPU data:
Output Audio Word Alignment | Audio Word Length | Right-rotation (multiple of 4-bit positions) | XMASK | XROT |
---|---|---|---|---|
LEFT | 16 | 16 | 0xFFFF0000 | 0x4 |
LEFT | 20 | 12 | 0xFFFFF000 | 0x3 |
LEFT | 24 | 8 | 0xFFFFFF00 | 0x2 |
RIGHT | 16 | 0 | 0x0000FFFF | 0x0 |
RIGHT | 20 | 0 | 0x000FFFFF | 0x0 |
RIGHT | 24 | 0 | 0x00FFFFFF | 0x0 |
Assuming that a Q31 data word 0xFA5AFxxx (where x-marked nibbles of the data are applied as padding bits of the word) is generated on the MCASP CFG (peripheral) port. To transmit a left-aligned 20-bit version of same word, preserving the MSBs, according to the Table 12-309, the user must set XMASK = 0xFFFFF000, and to select a right-rotation to 12 positions (XROT = 0x3).
Assuming that a right-aligned Q31 data word - 0x yyyyE4B4 is generated by software on the MCASP CFG (peripheral) port (with the presumption that y-marked nibbles of the input data are applied as padding bits). To transmit a right-aligned 16-bit version of same word, preserving the MSBs, according to the table MCASP TFU Example Settings, user is supposed to set XMASK = 0x0000FFFF, and to select right-rotation to 0 positions (XROT = 0x0).
The above examples use internal representation in integer and Q31 notation, but other fractional notations are also possible.