FRDM K20D50M I2C alternate channels

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDM K20D50M I2C alternate channels

Jump to solution
1,174 Views
thatonesaxkid
Contributor II

Hey Freescale community,

I'm using the FRDM K20D50M board along with the Adafruit Motor Shield V2 (an Arduino shield). The shield requires that I send commands using I2C, where SCL is on PTB2 and SDA is on PTB3. After a long time searching through the schematic for the FRDM board, it looks like the board's I2C hardware can go through an alternate channel to reach those pins also, however, I am banging my head against the wall trying to find some sort of documentation about how to set up I2C for alternate channels. I am using Keil MDK-ARM which doesn't have any I2C driver for this board.

Any explanation or links to other posts, documentation, or code would be greatly appreciated.

Thanks!

Chris :smileyhappy:

1 Solution
606 Views
mjbcswitzerland
Specialist V

Christopher

_CONFIG_PERIPHERAL(B, 3,  (PB_3_I2C0_SDA | PORT_ODE | PORT_PS_UP_ENABLE)); // I2C0_SDA on PB3 (alt. function 2)

_CONFIG_PERIPHERAL(B, 2,  (PB_2_I2C0_SCL | PORT_ODE | PORT_PS_UP_ENABLE)); // I2C0_SCL on PB2 (alt. function 2)

That is set

PORTB_PCR3 = (0x00000223);

PORTB_PCR2 = (0x00000223);

Regards

Mark

P.S: See the table in the user's manual in the section "Signal Multiplexing and Pin Assignments"

View solution in original post

0 Kudos
3 Replies
607 Views
mjbcswitzerland
Specialist V

Christopher

_CONFIG_PERIPHERAL(B, 3,  (PB_3_I2C0_SDA | PORT_ODE | PORT_PS_UP_ENABLE)); // I2C0_SDA on PB3 (alt. function 2)

_CONFIG_PERIPHERAL(B, 2,  (PB_2_I2C0_SCL | PORT_ODE | PORT_PS_UP_ENABLE)); // I2C0_SCL on PB2 (alt. function 2)

That is set

PORTB_PCR3 = (0x00000223);

PORTB_PCR2 = (0x00000223);

Regards

Mark

P.S: See the table in the user's manual in the section "Signal Multiplexing and Pin Assignments"

0 Kudos
606 Views
thatonesaxkid
Contributor II

Thanks! Where can I find the user's manual? All I've found is this: http://cache.freescale.com/files/microcontrollers/doc/user_guide/FRDM-K20D50MUM.pdf which tells me basically nothing useful.

Chris

0 Kudos