SLAU857A May 2021 – July 2021 MSP430FR2476 , MSP430FR2512 , MSP430FR2522 , MSP430FR2532 , MSP430FR2533 , MSP430FR2632 , MSP430FR2633 , MSP430FR2672 , MSP430FR2673 , MSP430FR2675 , MSP430FR2676
It is recommended to use the provided UART and I2C library functions for development to communicate with the host MCU. First of all, the default code generated by the GUI completes the I/O configuration and clock configuration of UART (eUSCI_A0) and I2C (eUSCI_B0) in the BSP_configureMCU() function. Therefore, it is only necessary to configure the communication module and write the communication protocol. If you need to modify the communication interface, check the datasheet to see if you need to modify the SYSCFG3 register to redirect the communication port.
UART-based communication development:
There are two schemes for I2C-based communication development for reference. The scheme occupies less code, and the second scheme saves development time.
Option one:
Option two★:
Table 5-13 shows the information related to the custom communication function.
Number | Object | Modification method | Comment |
---|---|---|---|
1 | eUSCI_A0/eUSCI_B0 port | Modify the pin definition in Captivate_app->CAPT_BSP.C->BSP_configureMCU() | Select other communication peripherals, need to modify the initialization of the peripherals. |
2 | IRQ signal of I2C | Modify the macro definition of IRQ pin in Captivate->COMM->CAPT_CommConfig.h Modify the macro definition of IRQ pin action in Captivate->COMM->I2CSlave.h | This pin is used to remind the host computer of a touch event. |
3 | Whether the CapTIvate module enables the Timer peripheral | Modify the assignment of FUNCTIONTIMER__ENABLE in CapTIvate->COMM->FunctionTimer.h | Used for timeout function in I2C communication. |
5 | Timeout function of I2C communication | Modify the assignment of I2CSLAVE__TIMEOUT_ENABLE in Captivate->COMM->I2CSlave_Definitions.h Modify the assignment of I2CSLAVE__TXFR_TIMEOUT_CYCLES in Captivate->COMM->I2CSlave_Definitions.h | By default, the host resets I2C if a single frame transmission exceeds 8 ms. |
5 | Modify I2C address | Modify I2CSLAVE__ADDRES in CapTIvate->COMM->I2CSlave_Definitions.h |