PWM #1 - Nuvoton's Limited Libraries
- BÜNYAMİN BUĞRA KORKMAZER
- May 14, 2023
- 1 min read
Updated: May 15, 2023
Hello dear readers, when we look at the technical features of microcontrollers, we sometimes may not find the exact equivalent of these features in the libraries provided by the manufacturing companies. I encounter this issue especially when working with ARM-based microcontrollers of Nuvoton. The libraries of their 8051-based processors often do not contain the features we desire. In this article, we will explore together how to control the PWM channel on ARM-based M031TB microcontrollers.

Although there are many extensive resources about PWM, we can simply define PWM here as a modulation signal carrying voltage information. Nuvoton's provided PWM library and sample applications can sometimes become insufficient beyond a certain point. For example, the PWM_ConfigOutputChannel() function it uses to change the Duty Cycle resets the PWM unit from start to finish each time we want to set a Duty Cycle. In addition, it excessively limits the hardware offering 16-bit resolution by taking values between 0-100. Being new in the microcontroller market and not being as popular as brands like STM32 can lead to such deficiencies.
Throughout this article series, we aim to create a structure where we can control the PWM unit to achieve a 16-bit resolution and adjustable frequency. In addition, we will perform various applications by generating different signals from the PWM unit and share our work with the Engineering ecosystem in Turkey.
In this article series, we will use;
Nuvoton M031TB development kit
Keil uvision 5.36 IDE
M031/M032 Series Technical Reference Manual
Nuvoton Github account.

Now, let's start to examine the PWM unit in detail through the Reference Manual.
Comments