SLAAEF9A November 2023 – May 2025 MSPM0C1104 , MSPM0G3507 , MSPM0H3216 , MSPM0L1227 , MSPM0L1227-Q1 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1306 , MSPM0L2227 , MSPM0L2227-Q1 , MSPM0L2228 , MSPM0L2228-Q1
The MSPM0 design flow is shown below. This example aims to use PWM to drive LED.
When the environment is ready, import code into CCS. 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 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 to the MSPM0 SDK example folder.
Figure 2-43 Code Example FileTo see the SysConfig configuration, open the .syscfg file. Select TIMER-PWM section to generate PWM, as shown in Figure 2-44. Check the PWM clock configuration, like self frequency and duty cycle. In this case, PWM frequency is 2.7Hz and 75% duty cycle. Users can change duty cycle easily through typing 50% in desired duty cycle, and then counter compare value changes automatically.
Figure 2-44 PWM Configuration in
SysConfigTo further elaborate on each feature module, click the question mark (?) next to each item.
Figure 2-45 To Get Detailed Information of
Each ItemCheck the rest feature of TIMER-POWER module and pins being used by clicking the chip icon in the top right. Check the highlighted pins for the PWM.
Figure 2-46 Pins ConfigurationWhen the project is saved and rebuilt, SysConfig updates the files in Figure 2-47. At this point, the example hardware configuration has been modified to match the full functionality of the original software being ported.
Figure 2-47 The files SysConfig
UpdatesThe 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.
Plug the LaunchPad to the computer. According to pins configurations, use DuPont cables to connect the PA12 to the LED pins.
Figure 2-48 Hardware SetupStart the debug by clicking the debug icon. Set breakpoint by double-clicking the space before the line number or adding one line code __BKPT();
Figure 2-49 Add Breakpoint SolutionsTry 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.
The specific steps are shown in Figure 2-50. 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 the wanted CAD format and Pin ordering, and get the Altium design lib file.
Figure 2-50 Ultra Librarian Tool
DownloadAs the lib has been downloaded, the next step is to run Altium Designer script and generate PCB lib and schematic library, as shown in Figure 2-51.
Figure 2-51 Run Altium Designer ScriptAfter completing the steps, the following new files are going to generated in the same source folder.
Figure 2-52 PCB Library and Schematic
FileThe final step is to import them into the AD lib, as shown in Figure 2-53. Based on this, a schematic and PCB can be designed.
Figure 2-53 Import library