Hello. Me too, i have problems with SAI. I do not understand §38.3.2.1 of the reference manual. Here is my analysis of the first case i.e. using transmitter bit clock :
"Configure the transmitter for asynchronous operation and the receiver for
synchronous operation." I understand "write 0 in SYNC field of TCR2 register, and 1 in SYNC field of RCR2 register" while TE field in TCSR register and RE field in TCSR register are still in 0 state.
"Enable the receiver in synchronous mode only after both the transmitter and receiver
are enabled." I understand : "write 1 in SYNC field in RCR2 only after TE field in TCSR and RE field in RCSR are both set to 1.
So what is the correct order in this trouble interpretation ?
Others questions are: "is it necessary to configure anything in the receiver if the tranmitter only is used ?" and the symetrical question...
I am using SAI2 on TEENSY 4.0 board, and teensyduino IDE, and I try to understand how it works. Their libraries are so complex that I strip them down to extract only what concerns the hardware, checking every registers setting with reference manual. The simplest thing I did is configuring the transmitter to send permanently the same 32 bits word in a monophonic chanel. Just checking "FIFO Request Flag" in TCSR in main loop, no interrupt, no DMA. When this flag is set, I write 0xAAAAAAAA in TDR0 register. I got correct square signals on TX_BCLK and TX_SYNC outputs (3.072 MHz and 48 kHz), correct signal on TX_DATA output (16 pulses in when TX_SYNC is high). But if in the same time I toggle a GPIO port this one does not produce the awaited 24 kHz square signal: it is completly asynchronous with TX_SYNC, with a higher frequency.