Right-justified I2S?

Status
Not open for further replies.

bacteria

Member
Hello!

I'm for all intents and purposes new to Teensy, even though I registered a few years ago. Also pretty new to Arduino, though I've used other IDEs for PIC32/ARM/AVR over the years.

I just got a 3.6 and played around with the audio shield, works great! I also want to attempt to interface to an AK4552 (not 4558) board I made. Right now I just have a sine outputting to I2S, and I'm looking at the clocks/serial on my scope. The data stream output from the Teensy is left-justified, and I was wondering if there was a register I could set, or a couple lines I could add to make the audio library I2S right-justified? The 4552 is a simple chip (no I2C feature) so anything I do has to be on the Teensy.

If someone could point me in the right direction, I would be grateful. I don't know my way around Arduino/Teensy well enough to know where to start looking.

Maybe it's something in the audio library source I can comment out and replace with something else for right-justified I2S? Some header file?

~

The AK4552 expects 24bit audio, though I know the audio library currently only supports 16bit. I noticed that with the data stream justified to the left, only the 8 least significant bits were being read by the codec, and that if I set the sine amplitude really low I started seeing an 8bit sine on the codec output, rather than a lot of noise.
 
The processor chips used on the Teensy family allow a great amount of flexibility in how the peripherals can be configured. I've only programmed the I2S interface on the Teensy 3.2. But the one on the T3.6 has similar (if not more) capabilities. Check out the Datasheet. For the T3.6 processor, the I2S interface information is in Section 61.
 
Hi! Thanks for the reply.

Yes I had a peek at the datasheet.

I think I should rephrase my question. As someone relatively new to the arduino IDE (so, unfamiliar with its structure, and how projects are built), if I wanted to change the I2S format slightly, am I expected to edit the input_i2s.h/cpp and etc accordingly? Or are there in-build arduino/routines/variables that I can just add to my sketch to handle that?
 
For any files that need to be changed, you should make your own private versions (with different file names) rather than modifying the official library files. Later, you might enter a Pull Request with your modifications for PJRC to consider inclusion in a future release.
 
Status
Not open for further replies.
Back
Top