This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
我们正在 使用连接到加速器与I2C总线的MSP430FR4133。
我们正在使用 IAR 8
我们希望使用P5 PIN2和3 或P8 PIN2和3 -请建议您选择哪一种。
我们正在尝试使用ESCI库 -但没有成功:
此部件通行证:
EUSCI_B_I2C_initMasterParam ={0};
param.selectClockSource = EUSCI_B_I2C_CLOCKSOURCE_ACLK;
PARAM.i2cClk = CS_getACLK();
Param.datarate = EUSCI_B_I2C_SET_DATA_RATE_100KBPS;
Param.byteCounterThreshold = 1;
param.autoSTOPGeneration = EUSCI_B_I2C_NO_AUTO_STOP;
EUSCI_B_I2C_initMaster (EUSCI_B0_BASE,¶m);
不清楚如何配置物理针脚 (正确吗?)
EUSCI_B_I2C_remapPins (EUSI_B0_BBASE,2+3);
GPIO_setAsPeripheralModuleFunctionInputPin (GPIO_PORT_P5, GPIO_PIN2 + GPIO_PIN3,GPIO秒
此部分也通过了:
// EUSCI B I2C enableInterrupt (EUSI_B0_BBASE,EUSI_B_I2C_Transmit_INTERRUPT0 + EUSI_B_I2C_STOP_INTERRUPT);
//指定从属地址
EUSCI_B_I2C_setSlaveAddress (EUSCI_B0_BASE,0x0D);//slaver_address);
//在TX模式下设置主中继器
EUSCI_B_I2C_setMode (EUSCI_B0_BBASE,EUSCI_B_I2C_Transmit_mode);
//启用I2C模块以启动操作
EUSCI_B_I2C_ENABLE (EUSCI_B0_BASE);
然后,我在这条线上备货:
EUSCI_B_I2C_masterSendSingleByte (EUSCI_B0_BASE,0x00);
请提供建议。
如果您有一个[pre[ared example I for MSP430FR4133 (MSP430FR4133的前一个示例I),我会非常感谢。
巴西,
Shimon
您好,Shimon,
连接到加速计时,您可以使用msp430fr4133中I2C的主模式。 我们有两种I2C演示代码-寄存器级代码和驱动程序库代码。 所有演示代码都是attached.e2e.ti.com/.../eusci_5F00_b_5F00_i2c_5F00_ex1_5F00_masterRxMultiple.ce2e.ti.com/.../msp430fr413x_5F00_euscib0_5F00_i2c_5F00_10.c
我建议您使用注册级别代码。(代码的大小会更小)
此致
Gary