Transmitting and receiving

nRF54LM20A | nRF54LM20B Datasheet

TDM supports both transmission (TX) and reception (RX) of serial data. In both cases the serial data is shifted synchronously to the SCK clock signal.

TX data is written to the SDOUT pin on the falling edge of SCK, and RX data is read from the SDIN pin on the rising edge of SCK. To change the active edge of SCK, use register CONFIG.SCK.POLARITY.

The most significant bit (MSB) is always transmitted first.

TX and RX are available in both Master and Slave modes and can be enabled/disabled independently in CONFIG.RXTXEN.

Transmission and/or reception is started by triggering the START task. When transmission is enabled in CONFIG.TXEN), the TXPTRUPD event will be generated for every number of transmitted data words given by TXD.MAXCNT. Each data word contains one or more samples. The TXPTRUPD event is generated just before MAXCNT number of bytes have been transmitted. Similarly, when reception is enabled in CONFIG.RXTXEN, the RXPTRUPD event is generated just after MAXCNT number of bytes have been received.

The CONFIG.ORS register stores extra samples used to align frames.
  • When transmitting and receiving, if the receive size (RXD.MAXCNT) exceeds the transmit size (TXD.MAXCNT), additional bytes are sent after TXD.MAXCNT bytes have been transmitted. These extra bytes are being sent while RXD.MAXCNT bytes are received and continue until the frame is completed.
  • When only transmitting, extra samples are sent after TXD.MAXCNT bytes have been transmitted to complete the frame.

If transmitting more samples than receiving (TXD.MAXCNT is larger than RXD.MAXCNT), the additional received samples will be discarded.

During receive-only operation, once RXD.MAXCNT bytes have been received, any further samples are discarded.

CONFIG.ORS follows the layout of a 32-bit memory word and can contain four 8-bit samples, two 16-bit samples, one right-aligned 24-bit sample sign-extended to 32 bit, or one 32-bit sample. The size of the samples is dependent on CONFIG.SWIDTH. For details on the memory word layout, see Channel mask and EasyDMA.

The MAXCNT event is generated synchronously to the active FSYNC edge at the beginning of a frame after transmitting RXD.MAXCNT bytes. The initial MAXCNT event is generated at the first active edge of FSYNC after the START task has been triggered. The MAXCNT event is generated once all data has been transmitted and/or received. The data will be available in RAM upon completion of the EasyDMA operation.

Transmission can be aborted by using the ABORT task. This will abort TDM transfer possibly without completing MAXCNT words, and will cause the ABORTED event to be generated.

The following figure shows an example of transmitting and receiving aligned data using the following TDM configuration.
Figure 3. Transmitting and receiving data
Transmitting and receiving data