Is there TDM driver/demo for LPC55S66

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there TDM driver/demo for LPC55S66

1,220 Views
shaozhongliangs
NXP Employee
NXP Employee

In UM11126, the LPC55S6x I2S interface features description:

     TDM with a several stereo slots and/or mono slots is supported. Each channel pair can act as any data slot. Multiple channel pairs can participate as different slots on one TDM data line.

     But I checked the latest SDK_2.6.3_LPC55S66.zip, can't find any TDM driver or demo to show how use TDM feature. Any comment for  TDM peripheral driver in LPC55S66?

pastedImage_1.png

Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

1,100 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi SZ,

There is not I2S TDM demo included in SDK package. User has to implement by self according to UM.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

634 Views
anousheh
Contributor I

Hi there,

I need assistance with a driver or a detailed explanation on how to use I2S in TDM mode. Based on the user manual, there aren't many registers available, and I'm having trouble distinguishing it from DSP mode. The instructions for configuring this peripheral in TDM mode are quite vague.

For my use case, I need TDM with 4, 8, or 16 channels. I attempted to configure it using the MCUXConfig utility, but it didn't produce the results I was looking for. I need a simple I2S data line configuration where each channel is 16 bits wide and placed consecutively. For example, the data would be stored for TDM 4 in the following format:

int16_t sine_480_arr[100] __attribute__((aligned(4)))= {0x0000, 0x0809, 0x100A, 0x17FB, 0x1FD4, 0x278D, 0x2F1E, ...};
int16_t sine_960_arr[100] __attribute__((aligned(4)))= {0x0000, 0x100A, 0x1FD4, 0x2F1E, 0x3DA9, 0x4B3B, 0x579E, ...};
int16_t sine_1920_arr[100] __attribute__((aligned(4)))= {0x0000, 0x1FD4, 0x3DA9, 0x579E, 0x6C12, 0x79BB, 0x7FBE, ...};
int16_t sine_3840_arr[100] __attribute__((aligned(4)))= {0x0000, 0x3DA9, 0x6C12, 0x7FBE, 0x73D0, 0x4B3B, .... };

uint8_t comb_sine[800] __attribute__((aligned(4)))= {0};

// main()
	for (size_t i = 0, p = 0; i < 800; p++, i+=8)
	{
		comb_sine[i+0] = sine_960_arr[p] & 0xFF;
		comb_sine[i+1] = sine_960_arr[p] >> 8;  
		comb_sine[i+2] = sine_3840_arr[p] & 0xFF;
		comb_sine[i+3] = sine_3840_arr[p] >> 8;
		comb_sine[i+4] = sine_480_arr[p] & 0xFF;
		comb_sine[i+5] = sine_480_arr[p] >> 8;
		comb_sine[i+6] = sine_1920_arr[p] & 0xFF;
		comb_sine[i+7] = sine_1920_arr[p] >> 8;
	}

s_TxTransfer.data     = &comb_sine[0];
s_TxTransfer.dataSize = sizeof(comb_sine);

    I2S_TxTransferSendDMA(FLEXCOMM2_PERIPHERAL, &FLEXCOMM2_Tx_DMA_Handle, s_TxTransfer);
    I2S_TxTransferSendDMA(FLEXCOMM2_PERIPHERAL, &FLEXCOMM2_Tx_DMA_Handle, s_TxTransfer);

 Any asist would be appreciated,

Best regards

0 Kudos
Reply