SSDA014 September   2026 MSPM0G5117 , MSPM0G5187

 

  1.   1
  2. 1 Description
  3. 2 Required Peripherals
  4. 3 Compatible Devices
  5. 4 Design Steps
  6. 5 Design Considerations
  7. 6 Software Flowchart
  8. 7 Application Code
  9. 8 Data Flow Examples
  10. 9 Additional Resources
  11. 10Trademarks

Design Steps

  1. Set up the TinyUSB module in SysConfig. Add one CDC instance (CDC_0). SysConfig allocates three endpoints automatically: notification IN (EP_IN2), data IN (EP_IN1), and data OUT (EP_OUT1).
  2. Configure the USB clock tree. The two platforms use different clock paths. On MSPM0G5187: enable the PLL and USB FLL, set UDIV to 2, and select HSCLKMUX_SYSPLL0. On MSPM0C5116: enable only the USB FLL (no PLL needed), set UDIV to 2, and select HSCLKMUX_USBFLL.
  3. Set up the I2C module in SysConfig.
    1. Enable I²C Controller mode.
    2. Set the bus speed to Fast Plus (1 MHz) on MSPM0G5187 or Fast (400 kHz) on MSPM0C5116.
    3. Configure DMA event1 trigger as CONTROLLER_RXFIFO_TRIGGER and assign DMA_CH0 in Fixed addr. to Block addr. mode.
    4. Configure DMA event2 trigger as CONTROLLER_TXFIFO_TRIGGER and assign DMA_CH0 in Block addr. to Fixed addr. mode.
    5. In the Interrupt Configuration tab, enable the EVENT1_DMA_DONE, EVENT2_DMA_DONE, and NACK interrupts.
  4. Set up the GPIO module in SysConfig.
    1. Add one input GPIO pin named I2C_SIGNAL configured for rising-edge interrupt with pull-down resistance. This pin connects to the I2C target device's data-ready output.
    2. Enable the input interrupt. On MSPM0G5187, map the GPIO to Interrupt Group 1.
      void GROUP1_IRQHandler(void)
      {
          switch (DL_Interrupt_getPendingGroup(DL_INTERRUPT_GROUP_1)) {
              case GPIO_INT_IIDX:
                  switch (DL_GPIO_getPendingInterrupt(GPIO_PORT)) {
                      case GPIO_I2C_SIGNAL_IIDX:
                          // Slave signaled data ready - set flag for main loop
                          i2ctargetDataReady = true;
                          break;
      
                      default:
                          break;
                  }
                  break;
      
              default:
                  break;
          }
      }
      On MSPM0C5116, the GPIOB interrupt is used directly.
      void GPIOB_IRQHandler(void)
      {
          switch (DL_GPIO_getPendingInterrupt(GPIO_PORT)) {
              case GPIO_I2C_SIGNAL_IIDX:
                  // Slave signaled data ready - set flag for main loop
                  i2ctargetDataReady = true;
                  break;
      
              default:
                  break;
          }
      }
  5. Set up SysTick in SysConfig. Enable SysTick with a period matched to the CPU frequency: 80000 cycles for MSPM0G5187(80 MHz) or 48000 cycles for MSPM0C5116(48 MHz). Both values give a 1ms period. TinyUSB's board_millis() requires this 1ms period.