FRDM K20D50M I2C alternate channels

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FRDM K20D50M I2C alternate channels

跳至解决方案
2,033 次查看
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 解答
1,465 次查看
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 项奖励
回复
3 回复数
1,466 次查看
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 项奖励
回复
1,465 次查看
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 项奖励
回复