I'm attempting to use the MCUX SDK i2s_dma_driver to send 24-bit frames on an LPC55S69 and I'm running into trouble. The code I'm working on is being ported from the MK22FN1M0 but doesn't use the SDK. The LPC55S69 user's manual is less clear than the Kinetis manual when it comes to describing I2S data formats. The SDK manual has virtually no explanation.
To match the Kinetis version, what I'm attempting to do is to send a buffer of single-channel, 24-bit frames. The source data is stored in a buffer of 32-bit integers, left justified. I can't find any combination of settings that gives me the results I expect, and I'm concerned about the fact that the TX function takes the number of bytes and not frames or words. It's not clear what it's counting.
I'm testing with a repeating value of 0xffffff00 and the expected result is the data line staying high for the whole transmission. The leftJust setting seems to have no effect on the results.
Any idea how this should be set up?
Thanks,
Scott
The DMA on this LPC part does not support 24bit transfers. So you will have to manually zero pad your frames to either support 16/32 bit and configure your codec accordingly. This solved it for us.
Any Updates here? Working on s similar issue with FreeRTOS USB speker demo wanted Audio stream to work with 24bit 48khz. Was able to to get 32 bit and 16bit working fine.
Will above be the root cause?
Hi,
What would really help me is if you could give this in terms of the SDK driver. The driver doesn't expose FIFOWR and the I2S DMA driver in particular is lacking any description of how it actually passes data to the I2S module.
My input buffer is composed of 32-bit values of which only the high 24 bits are significant. I need to send just those 24 bits per word. What settings do I use for the SDK driver to accomplish that?
It's not urgent now because I've worked around it by modifying my data to be right-justified but I'd still like to understand what's going on.
Thanks,
Scott
Hi, Scott,
You can configure the LEFTJUST bit with the driver for tramsmitter:
static i2s_config_t s_TxConfig;
static i2s_config_t s_RxConfig;
I2S_TxGetDefaultConfig(&s_TxConfig);
s_TxConfig.divider = DEMO_I2S_CLOCK_DIVIDER;
s_TxConfig.masterSlave = DEMO_I2S_TX_MODE;
s_TxConfig.leftJust=true;
I2S_TxInit(DEMO_I2S_TX, &s_TxConfig);
You can configure the LEFTJUST bit with the driver for receiver:
I2S_RxGetDefaultConfig(&s_RxConfig);
s_RxConfig.divider = DEMO_I2S_CLOCK_DIVIDER;
s_RxConfig.masterSlave = DEMO_I2S_RX_MODE;
s_RxConfig.leftJust=true; //true:left justified data, false:right justfied data
I2S_RxInit(DEMO_I2S_RX, &s_RxConfig);
Hope it can help you
BR
XiangJun Rong
The LEFTJUST setting didn't seem to be doing anything. All of my data comes from a lookup table anyway, so I just rebuilt the table with right-justified data.
I guess just consider this a documentation request, to clarify the data format options with a diagram like the Kinetis equivalent has.
Thanks,
Scott