[MS51] Adjusting PWM Duty Cycle Based on ADC Input Voltage

Post Reply
chhsieh3
Posts: 307
Joined: 13 Mar 2020, 09:08

20 Feb 2023, 11:55

  • Application: This example code uses MS51 PWM to output 10 kHz waveform with 0~100% duty cycle according to 0~3V ADC input voltage.
  • BSP Version: MS51_Series_BSP_Keil_V1.00.004
  • Hardware: NuTiny-MS51DA V1.1
This example code uses MS51 PWM to output 10 kHz waveform with 0~100% duty cycle according to 0~3V ADC input voltage. The following sections show how to use ADC to sample an analog voltage and convert to 12-bit binary representation, and how to change PWM duty cycle through an ADC conversion result.

You can download the sample code at https://www.nuvoton.com/resource-downlo ... 1508110269
Nuvoton

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests