FRDM K20D50M I2C alternate channels

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FRDM K20D50M I2C alternate channels

ソリューションへジャンプ
2,034件の閲覧回数
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:

ラベル(2)
1 解決策
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 件の賞賛
返信
3 返答(返信)
1,467件の閲覧回数
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,466件の閲覧回数
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 件の賞賛
返信