Aurix TC3XX: I2S Emulation

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User20237
Level 1
Level 1
10 replies posted 5 replies posted First reply posted
Hello,

I want to develop an emulated I2S driver basing on QSPI Autosar driver.
According to Autosar , the driver supports only full-duplex mode, however I2S should be in simplex mode.

Is there any QSPI driver developped by infineon that supports simplex mode?
In the datasheet of TC3XX, I did not find any register that seletcs the mode type (Full-duplex, Half-duplex, Simplex) of QSPI. Do you have any idea?

Thank you
Best regrads,
0 Likes
6 Replies
User20237
Level 1
Level 1
10 replies posted 5 replies posted First reply posted
Any idea?
Thank you for any help you can provide.
0 Likes
Darren_Galpin
Employee
Employee
First solution authored First like received
The spec says that the QSPI operates in duplex, half-duplex or simplex depending on whether the transmission and reception appear simultaneously or not - the module itself does not differentiate between the type of connection. See section 37.2.3 - QSPI->Overview->Operating Modes.
0 Likes
MarkusNoll
Employee
Employee
25 replies posted 10 likes received 25 sign-ins
Hi Sarah,

I²S is in general possible with Aurix, but as there isn't a native I²S module inside our device a little bit tricky.


Here some hints in case you want to use Aurix as I²S master:

The basic idea is to use the GTM (various synchronized TOM modules) to generate the I²S clocking-signals (e.g. MCLK, BCLK, WCLK) and to use the QSPI (in slave mode) just for shifting in/out the serial data.
MCLK and WCLK are connected directly to external audio-devices, the BCLK has to be connected both to external audio-device and QSPI device in slave mode.
4720.attach

Besides this, you have to provide a "one-time" sync signal from the GTM to the QSPI's slave-select module. This signal only does one single high-low transition and syncs up the QSPI with the MSB of the I²S frame.
Afterwards, QSPI stays in e.g. 32-bit framing configuration. So no further slave-select toggling needed.

4722.attach
With this basic concept you can emulate in fact all protocols (left-justified, I²S or TDM) and all various framing-lengths (16-bit, 24-bit, 32 bit) It's just a matter of configuration.
Depending on the device you can even run up to 5 times full-in-sync I²S bidirectionally.

In case you are interested I can share some example code for you how to implement e.g. a simple-audio loopback.
If this will work out with the AUTOSAR SPI driver - i doubt it to be honest. For I²S, QSPI needs to be in slave mode and besides that (I²S is a streaming protocol) you have to guarantee that you constantly hold your data from the SPI module or put data back in order not to get
sample underruns.

Can you tell me a little bit more about your application?
Background of the question is, that the solution above is based on the GTM's internal max. 200 MHz clocking frequency and MCLK/BCLK/WCLK must be full in sync and can only be an integer-divided value from the 200 Mhz. This means that in case you want to operate at e.g. 48 khz,
that your real f_s will be 48.83 kHz.

In case very precise sampling rates are needed or in case you want to implement an AVB system where you have to recover the network audio-clock you can also inject a reference-clock signal externally inside the GTM modules and generate all I²S clocking based on an external ref-clock.
See in the picture below how to inject external reference-clocks - in this case this shows a network audio-clock recovery via the Ethernet's PPS output
4723.attach
User20237
Level 1
Level 1
10 replies posted 5 replies posted First reply posted
Thank you MarkusNoll for the details.
Could you please share with me the example?

My application is: AurixTc3xx->Emulated I2S->Audio Amplifier->Speaker.
For Autosar SPI, it's working only in master mode:
[SWS_Spi_00040] ⌈ The SPI Handler/Driver handles only the Master mode.⌋ ()
0 Likes
MarkusNoll
Employee
Employee
25 replies posted 10 likes received 25 sign-ins
Hi Sarah,

please check your PM inbox.
0 Likes
User20237
Level 1
Level 1
10 replies posted 5 replies posted First reply posted
Hi Noll,

I have already sent you an email. Did you receive it?

Thanks!
0 Likes