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:
Solved! Go to Solution.
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"
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"
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
Chris
You need details of the chip and not the board:
Regards
Mark