i.MXRT1176 SAI1 Data channels 2,3,4 & fifo combine Hi there. I'm trying to use as many SAI data pins as possible on the RT1176. I am aware that for SAI 1 data channels 2, 3, and 4, the Tx and Rx data lines share a pin, and so can only be assigned to Tx or Rx. Lets try and use all 3 of them all for Tx anyway.. So my configuration is SAI 1 pins: - Tx1 - Rx1 - Tx2 - Tx3 - Tx4 Using the config tool, I do this on the 'playback' tab Then I generate the code and run, but I hit an assert in fsl_sai_edma.c: #if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE
/* Allow multi-channel transfer only if FIFO Combine mode is enabled */
assert(
(saiConfig->channelNums <= 1U) ||
((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnWrite) ||
(saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite))));
#endif This suggests that you MUST use fifo combine if you use more than 1 SAI data channel. The manual states (p.3475): Combining FIFOs for transmit data channels allows one data channel to use the FIFOs of all enabled channel FIFOs, with identical data output on each enabled data channel. Combining FIFOs for receive data channels allows one data channel to use the FIFOs of all enabled channel FIFOs, with received data from channel 0 stored into each enabled data channel. This suggest that if using SAI 1 data pin2, 3, or 4 for Tx, they will all just output the same data as on pin1?! And if using them for Rx... well it doesn't say but it sounds like pins 2,3 and 4 will be ignored? Can you please clarify this or point me to some more detailed documentation? Are SAI1 data pins 2,3,4 independently usable at all? Many thanks. Re: i.MXRT1176 SAI1 Data channels 2,3,4 & fifo combine Thanks for the reply, I tested this today and it appears to work as described. It would be really useful to have this functionality detailed in the SAI FIFO combine section of the RT1176 ref manual because it currently reads as though it is not possible to have different data on different SAI 1 pins. Many thanks Re: i.MXRT1176 SAI1 Data channels 2,3,4 & fifo combine Hello @mttjcksn,
I highly recommend consulting this application note, where the multi-channel functionality is explained in greater detail.
Additionally, the FCOMB register indicates the following:
This means that the FIFO will store data for each enabled channel.
Also, if you exprience any issue, do not hesitate to let me know. BR Habib
View full article