SLAAEF9 November   2023 MSPM0L1306

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1MSPM0 Portfolio Overview
    1. 1.1 Introduction
    2. 1.2 Portfolio Comparison of Renesas RL78 MCUs to MSPM0 MCUs
  5. 2Ecosystem And Migration
    1. 2.1 Ecosystem Comparison
      1. 2.1.1 MSPM0 Software Development Kit (MSPM0 SDK)
      2. 2.1.2 The IDE Supported By MSPM0
      3. 2.1.3 SysConfig
      4. 2.1.4 Debug Tools
      5. 2.1.5 LaunchPad
    2. 2.2 Migration Process
      1. 2.2.1 Step 1. Choose The Right MSPM0 MCU
      2. 2.2.2 Step 2. Set Up IDE And Quick Introduction of CCS
        1. 2.2.2.1 Set Up IDE
        2. 2.2.2.2 Quick Introduction of CCS
      3. 2.2.3 Step 3. Set Up MSPM0 SDK And Quick Introduction of MSPM0 SDK
        1. 2.2.3.1 Set Up MSPM0 SDK
        2. 2.2.3.2 Quick Introduction of SDK
      4. 2.2.4 Step 4. Software Evaluation
      5. 2.2.5 Step 5. PCB Board Design
      6. 2.2.6 Step 6. Mass Production
    3. 2.3 Example
  6. 3Core Architecture Comparison
    1. 3.1 CPU
    2. 3.2 Embedded Memory Comparison
      1. 3.2.1 Flash Features
      2. 3.2.2 Flash Organization
        1. 3.2.2.1 Flash Memory Regions
        2. 3.2.2.2 NONMAIN Memory of MSPM0
        3. 3.2.2.3 Flash Memory Registers of RL78
      3. 3.2.3 Embedded SRAM
    3. 3.3 Power UP and Reset Summary and Comparison
    4. 3.4 Clocks Summary and Comparison
      1. 3.4.1 Oscillators
        1. 3.4.1.1 MSPM0 Oscillators
      2. 3.4.2 Clock Signal Comparison
    5. 3.5 MSPM0 Operating Modes Summary and Comparison
      1. 3.5.1 Operating Modes Comparison
      2. 3.5.2 MSPM0 Capabilities in Lower Modes
      3. 3.5.3 Entering Lower-Power Modes
      4. 3.5.4 Low-Power Mode Code Examples
    6. 3.6 Interrupts and Events Comparison
      1. 3.6.1 Interrupts and Exceptions
        1. 3.6.1.1 Interrupt Management of RL78
        2. 3.6.1.2 Interrupt Management of MSPM0
      2. 3.6.2 Event Handler of MSPM0
      3. 3.6.3 Event Link Controller (ELC) of RL78
      4. 3.6.4 Event Management Comparison
    7. 3.7 Debug and Programming Comparison
      1. 3.7.1 Debug Comparison
      2. 3.7.2 Programming Mode Comparison
        1. 3.7.2.1 Bootstrap Loader (BSL) Programming of MSPM0
        2. 3.7.2.2 Serial Programming (Using External Device) of RL78
  7. 4Digital Peripheral Comparison
    1. 4.1 General-Purpose I/O (GPIO, IOMUX)
    2. 4.2 Universal Asynchronous Receiver-Transmitter (UART)
    3. 4.3 Serial Peripheral Interface (SPI)
    4. 4.4 Inter-Integrated Circuit (I2C)
    5. 4.5 Timers (TIMGx, TIMAx)
    6. 4.6 Windowed Watchdog Timer (WWDT)
    7. 4.7 Real-Time Clock (RTC)
  8. 5Analog Peripheral Comparison
    1. 5.1 Analog-to-Digital Converter (ADC)
    2. 5.2 Comparator (COMP)
    3. 5.3 Digital-to-Analog Converter (DAC)
    4. 5.4 Operational Amplifier (OPA)
    5. 5.5 Voltage References (VREF)

Example

The MSPM0 design flow is shown below. This example aims to use PWM to drive LED.

  1. Choose the right MSPM0 MCU and select hardware and order an EVM, here we use Launchpad MSPM0L1306.
  2. Set up CCS and SDK, detail can be seen in Section 2.2.
  3. Code import.

    When the environment is ready, you can import code into CCS. As for this example, a timer is used to control PWM. The first thing to do is understand any differences between the timer modules between RL78 and MSPM0, and choose the similar example in SDK.

    The closet example in the SDK is probably ” timx_timer_mode_pwm_center_stop”. Once a similar example is found, open CCS and import the code example by going to Project --> Import CCS Projects... and navigate it to the MSPM0 SDK example folder.

    GUID-7D23B766-7C1A-426C-B483-F05D513CC62F-low.png Figure 2-44 Code Example File
  4. Modify project.

    To see the SysConfig configuration, open the .syscfg file. Select TIMER-PWM section to generate PWM, as shown in Figure 2-45. Check the PWM’s clock configuration, like self frequency and duty cycle. In this case, PWM frequency is 2.7Hz and 75% duty cycle. You can change duty cycle easily through typing 50% in desired duty cycle, and then Counter compare Value changes automatically.

    GUID-ED9F2FC7-FD81-48D9-9154-6658CA1C4753-low.png Figure 2-45 PWM Configuration in SysConfig

    To further elaborate on each feature module, you can click “?” next to each item.

    GUID-A6BE827E-5A7F-41E2-8739-A7D4CEEE572A-low.png Figure 2-46 To Get Detailed Information of Each Item

    Also check the rest feature of TIMER-POWER module and pins being used by clicking the chip icon in the top right and checking the highlighted pins for the PWM.

    GUID-166DF66E-D895-438D-8A1C-441C88E6DC52-low.png Figure 2-47 Pins Configuration

    When the project is saved and rebuilt, SysConfig updates the files in Figure 2-48. At this point, the example hardware configuration has been modified to match the full functionality of the original software being ported.

    GUID-15E184AA-4396-4CAF-8A49-A3B6E3687D65-low.png Figure 2-48 The files SysConfig Updates

    The only remaining effort is to check application-level software. This example generates PWM waves like SDK code, so there is no need to change the .c file.

  5. Hardware setup.

    Get LaunchPad plugged into the computer. According to pins configurations, use DuPont cables to connect the PA12 to the LED pins.

    GUID-CA842DC8-A51F-46B4-91E1-BFE51F7731A2-low.png Figure 2-49 Hardware Setup
  6. Debug and verify.

    Start debug, by clicking debug icon. And you can set breakpoint by double-click the space before the line number or adding one line code __BKPT();

    GUID-B57826D1-9B36-4298-BEC2-122CD7FD2DD7-low.png Figure 2-50 Add Breakpoint Solutions

    Try to use debug functions (detailed can be seen in Section 2.2.2.2) and verify the feasibility of the procedure. While debugging, LED can be toggled as code is running step by step.

  7. Generate PCB library and import to Altium Design.

    The specific steps are shown in Figure 2-51. Go to the entrance of Ultra Librarian tool under MSPM0 device page (detailed can be seen in Section 2.2.5). Clink View options. Select your wanted CAD format and Pin ordering, then you can get the Altium design lib file.

    GUID-95AE2DAD-DD4D-44BE-874B-74CFAF21BDE3-low.png Figure 2-51 Ultra Librarian Tool Download

    As the lib have been downloaded, the next step is to run Altium Designer script and generate PCB lib and schematic library, as shown in Figure 2-52.

    GUID-EBEF1B64-D471-47DF-AECB-B04602CBF240-low.png Figure 2-52 Run Altium Designer Script

    After completing the steps, the following new files are going to generated in the same source folder.

    GUID-8BA8F367-D09B-49F1-9BBF-30C57944CC2D-low.png Figure 2-53 PCB Library and Schematic File

    The final step is to import them into your AD lib, as shown in Figure 2-54. And based on this, a schematic and PCB can be designed.

    GUID-D3A018F2-4FE7-437D-AD42-A97476C0CE21-low.png Figure 2-54 Import library
  8. Design in MSPM0.
  9. Mass production.