Changing I2S TX and RX pins

Status
Not open for further replies.

tenkai

Well-known member
Hello,

so I am working on a board using the SGTL5000, and I need to change the TX and RX pins for I2S.

My plan is to change them to pins 3 and 4 on a Teensy 3.1.

Since I don't have the hardware yet, I would like to walk through my plan of attack before I order my board.

I plan to copy the input_i2s and output_i2s files and make a new library.

Change output_i2s from:
Code:
CORE_PIN22_CONFIG = PORT_PCR_MUX(6); // pin 22, PTC1, I2S0_TXD0
to:
Code:
CORE_PIN3_CONFIG = PORT_PCR_MUX(6); // pin 3, PTC1, I2S0_TXD0

and also change input_i2s from:
Code:
CORE_PIN13_CONFIG = PORT_PCR_MUX(4); // pin 13, PTC5, I2S0_RXD0
to:
Code:
CORE_PIN4_CONFIG = PORT_PCR_MUX(4); // pin 13, PTC5, I2S0_RXD0

any reason this shouldn't work? is it CORE_PIN4_CONFIG or CORE_PIN04_CONFIG?
anything else I am obviously missing?

Thanks!
 
any reason this shouldn't work? is it CORE_PIN4_CONFIG or CORE_PIN04_CONFIG?
anything else I am obviously missing?

that should do. it's CORE_PIN4_CONFIG. fwiw, you don't need a new library, you could just pass config_i2s an argument i suppose, or use a switch in i2s_output / input. this works for me:

Code:
#ifdef _CLONE
    	CORE_PIN4_CONFIG  = PORT_PCR_MUX(6); // pin  4, I2S0_TX_FS (LRCLK)
    	CORE_PIN9_CONFIG  = PORT_PCR_MUX(6); // pin  9, I2S0_TX_BCLK
    	CORE_PIN28_CONFIG = PORT_PCR_MUX(6); // pin 28, I2S0_MCLK
#else
	CORE_PIN23_CONFIG = PORT_PCR_MUX(6); // pin 23, PTC2, I2S0_TX_FS (LRCLK)
	CORE_PIN9_CONFIG  = PORT_PCR_MUX(6); // pin  9, PTC3, I2S0_TX_BCLK
	CORE_PIN11_CONFIG = PORT_PCR_MUX(6); // pin 11, PTC6, I2S0_MCLK
#endif

Code:
#ifdef _CLONE
    	CORE_PIN3_CONFIG = PORT_PCR_MUX(6); // pin 3, I2S0_TXD0
#else
    	CORE_PIN22_CONFIG = PORT_PCR_MUX(6); // pin 22, PTC1, I2S0_TXD0
#endif

(that's for an output DAC only, so pin 4 is used as LRCLK).
 
Awesome, thank you for your reply! I will go ahead and order this board and hope for the best!
 
Status
Not open for further replies.
Back
Top