The program involved in this section of the hardware is relatively simple, mainly to investigate the application of the Stm32 clock
The principle of nature of things I would not say more, bibliography for:
"STM32 Library Development Practical Guide" Liu, Dr Yeung Sum
"STM32 Development Guide (library function Version)" On the punctual atom
A timer is used to control the I/O port output PWM waveform, which drives the LED light to appear similar to the normal breathing frequency of the light off.
Hardware circuit diagram:
What I have learned:
1
This is the STM32 data sheet on the TIM3 Universal Timer multiplexing function re-image description, assuming that the PA6 as a PWM output, you can see PA6 corresponding to TIM3 Channel 1,
Enable the function of TIM3 Channel 1 to be
TIM_OC1Init();
Similarly, if you want to enable PA7, which corresponds to the TIM3 Channel 2, then the function of Enable Channel 2 is:
TIM_OC2Init()
And so on, it should be noted that the function that enables different channels of the same timer is a small difference, preventing the Tim_oc1init () function from being called in the program to enable TIM3 Channel 2 to occur.
2
Look here, assuming that the TIM3 Channel 1 is used, then this is going to be written
TIM3->CCR1
Similarly, if you use the TIM3 Timer Channel 2, it is necessary to change the corresponding
TIM3->CCR2
This is also to prevent the original plan to use the TIM3 Channel 1, but here self-pendulum to write in order to TIM->CCR2 situation, such errors are generally very hidden, not easy to find.
The corresponding program has been uploaded, but do not know why the program can not be displayed here, need to download the resources to go to my download.
The project document is
PROGECT–>RVMDK (UV4) –>iso_stm32
PWM breathing lamp based on stm32