This paper presents a digital implementation of a brushless direct current motor (BLDCM) drive with a six-step pulse width modulation (PWM) using a programmable simplified C-block based on the STM32 microcontroller. The implementation is conducted through the PSIM simulation platform, which is commonly used for power electronics and motor control. This approach combines the benefits of using a programmable simplified C-block for precise and flexible programming with the PWM concepts of the STM32 microcontroller. The PWM method used on the BLDCM drive is the unipolar upper PWM technique (H~PWM_L~ON). The performance of the PWM implementation is analyzed in detail, including the accuracy of the PWM generation using a Fast Fourier Transform (FFT), the gating of the IGBTs in the three-phase inverter, and the effect of the duty cycle on the BLDCM's speed, phase voltage, and phase current.