When I use Teensy 3.2 with the Audio board I use the standard config so Teensy just plugs into the board using the standard pins as in the datasheet.
Pins 22 and 23 are I2S pins for the audio adaptor......they are also touchread pins.
I have project that uses all 12 touchread pins, so 22 and 23 not available for I2S, so I moved it to pins 3 and 4 as shown below in lines from output_i2s.ccp
boolean origi2s = true; .......I put this at top of the .ccp file and set it true for origi2s or false for not origi2s config. this allows me to switch for each project.
I also edit these lines below (2 instances of each) in the .ccp file ...............
if (origi2s == true) CORE_PIN22_CONFIG = PORT_PCR_MUX(6); // pin 22, PTC1, I2S0_TXD0
if (origi2s == false) CORE_PIN3_CONFIG = PORT_PCR_MUX(6); // pin 3, PTC12, I2S0_TXD0
if (origi2s == true) CORE_PIN23_CONFIG = PORT_PCR_MUX(6); // pin 23, PTC2, I2S0_TX_FS (LRCLK)
if (origi2s == false) CORE_PIN4_CONFIG = PORT_PCR_MUX(6); // pin 4, PTC13, I2S0_TX_FS (LRCLK)
I have to go to the output_i2s.ccp file and edit the top line depending on which project I am compiling.
If I simply set it in my sketch the compiler tells me not declared in this scope..error.
Is there a way of calling OR setting a flag from my sketch so it will be seen in scope and I dont have to edit the .ccp file each time.
Also the way I do it means I have to set this up each time I install a new version of Teensyduino.
P.S ...perhaps I should say the original lines are........
CORE_PIN22_CONFIG = PORT_PCR_MUX(6); // pin 22, PTC1, I2S0_TXD0
and
CORE_PIN23_CONFIG = PORT_PCR_MUX(6); // pin 23, PTC2, I2S0_TX_FS (LRCLK)
I added the bit "if origi2s == true" so I could select which one .......
Is there a better way of doing this...?????
Pins 22 and 23 are I2S pins for the audio adaptor......they are also touchread pins.
I have project that uses all 12 touchread pins, so 22 and 23 not available for I2S, so I moved it to pins 3 and 4 as shown below in lines from output_i2s.ccp
boolean origi2s = true; .......I put this at top of the .ccp file and set it true for origi2s or false for not origi2s config. this allows me to switch for each project.
I also edit these lines below (2 instances of each) in the .ccp file ...............
if (origi2s == true) CORE_PIN22_CONFIG = PORT_PCR_MUX(6); // pin 22, PTC1, I2S0_TXD0
if (origi2s == false) CORE_PIN3_CONFIG = PORT_PCR_MUX(6); // pin 3, PTC12, I2S0_TXD0
if (origi2s == true) CORE_PIN23_CONFIG = PORT_PCR_MUX(6); // pin 23, PTC2, I2S0_TX_FS (LRCLK)
if (origi2s == false) CORE_PIN4_CONFIG = PORT_PCR_MUX(6); // pin 4, PTC13, I2S0_TX_FS (LRCLK)
I have to go to the output_i2s.ccp file and edit the top line depending on which project I am compiling.
If I simply set it in my sketch the compiler tells me not declared in this scope..error.
Is there a way of calling OR setting a flag from my sketch so it will be seen in scope and I dont have to edit the .ccp file each time.
Also the way I do it means I have to set this up each time I install a new version of Teensyduino.
P.S ...perhaps I should say the original lines are........
CORE_PIN22_CONFIG = PORT_PCR_MUX(6); // pin 22, PTC1, I2S0_TXD0
and
CORE_PIN23_CONFIG = PORT_PCR_MUX(6); // pin 23, PTC2, I2S0_TX_FS (LRCLK)
I added the bit "if origi2s == true" so I could select which one .......
Is there a better way of doing this...?????
Last edited: