Page 260 - ARM Based Microcontroller Projects Using MBED
P. 260
246 8. INTERMEDIATE LEVEL PROJECTS
TABLE 8.4 Mbed PWM Functions
PWM Function Description
write Set the output duty-cycle
read Read the current output duty cycle
period Set the PWM period in seconds (float)
period_ms Set the PWM period in milliseconds (int)
period_us Set the PWM period in microseconds (int)
pulsewidth Set the PWM pulsewidth in seconds (float)
pulsewidth_ms Set the PWM pulsewidth in milliseconds (int)
pulsewidth_us Set the PWM pulsewidth in microseconds (int)
PWM GPIO Pin
PWM1/1 PA_8
PWM1/1N PB_13, PA_7
PWM1/2 PA_9
PWM1/2N PB_0, PB_14
PWM1/3 PA_10
PWM1/3N PB_15, PB_1
PWM1/4 PA_11
PWM2/1 PA_0, PA_15, PA_5
PWM2/2 PA_1, PB_3
PWM2/3 PB_10
PWM3/1 PB_4, PA_6, PC_6
PWM3/2 PB_5, PC_7
PWM3/3 PC_8
PWM3/4 PC_9
PWM4/1 PB_6
PWM4/2 PB_7
PWM4/3 PB_8
PWM4/4 PB_9
Some PWM-based projects are given in the next few sections to show how the PWM func-
tions can be used in projects. Notice that all these projects use the Nucleo-F411RE
development board.