Sending signal through I2S on Teensy 3.2

Status
Not open for further replies.

Kcvo

New member
Hi, I'm trying to test the I2S functionality on the Teensy and was seeing to test a simple sine wave to go through. As of now, I have initialized the I2S pins and am confused on what to do next? The code I have is posted below.



// Clock type constants
#define CLOCK_TYPE (I2S_CLOCK_48K_INTERNAL)
#define clock_per_sec 44100

void i2sSetup(){
PORTC_PCR8 |= (4<<8); //master clock Pin 28

PORTC_PCR1 |= (6<<8); // transmit data Pin 22
PORTC_PCR2 |= (6<<8); //transmit framse select Pin 23
PORTC_PCR3 |= (6<<8); //transmit bit clock Pin 9


PORTC_PCR5 &= (4<<8); //receieve data Pin 13
PORTC_PCR6 &= (4<<8); // receive bit clock Pin 11
PORTC_PCR7 &= (4<<8); //receiveframe select Pin12
}

void setup() {

i2sSetup();

}

void loop() {

}
 
You have so much more to do. This is barely even scratching the surface! The best suggestion I can give you is to start with the known-good Teensy Audio library.

https://www.pjrc.com/teensy/td_libs_Audio.html

Even if you intend to write all the low-level code yourself, at the very least you can use the library to check your hardware. The library's code can also serve as a reference to figure out how things work.
 
Okay, thanks! Is there any specific thing I should look at? Most of the examples in the audio library always implement the audio shield which I'm not using
 
Most of the examples in the audio library always implement the audio shield which I'm not using

Perhaps use the audio shield temporarily, only for the purpose of learning how the hardware works. Even if you wish to create very different hardware, starting from working and well documented hardware can save you a lot of time (and maybe even money) in the long run.
 
Status
Not open for further replies.
Back
Top