Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Dear Sir/Madam.
I have tried two methods to initial I2C in GPIO42 and GPIO43.
If I use Ti function to configure them as below, it works well.
GPIO_SetupPinMux(42, 0, 6);
GPIO_SetupPinMux(43, 0, 6);
if I use register to configure them as below, it doesn't work.
//设置数据端口
GpioCtrlRegs.GPBPUD.bit.GPIO42 = 0; // Enable pullup on GPIO34
GpioCtrlRegs.GPBGMUX1.bit.GPIO42 = 1;
GpioCtrlRegs.GPBMUX1.bit.GPIO42 = 2; // GPIO42 = SDAA
GpioCtrlRegs.GPBQSEL1.bit.GPIO42 = 3; // Asynch input
//设置时钟端口
GpioCtrlRegs.GPBPUD.bit.GPIO43 = 0; // Enable pullup on GPIO35
GpioCtrlRegs.GPBGMUX1.bit.GPIO43 = 1;
GpioCtrlRegs.GPBMUX1.bit.GPIO43 = 2; // GPIO43 = SCLA
GpioCtrlRegs.GPBQSEL1.bit.GPIO43 = 3; // Asynch input
I don't know why.
Could you help me check that, Thanks!
Have a good day!
Frank