[Embedded system experiment] 7 PWM output experiment

1 Development environment

  • STM32F407ZGT6
  • Wedge uVision 5

2 Experiment content

  1. Realize the numerical control of LED0 flashing with sine wave;
  2. At the same time, the control quantity is sent to the serial port to output a sine wave waveform;
  3. Use KEY0 interrupt mode to control start and stop.
    (1) Press KEY0, LED0 starts flashing, and the serial port outputs waveforms.
    (2) Press KEY0 again, LED0 and output waveform are paused;
    (3) Press KEY0 for the third time, LED0 and output waveform can be restored, and connected to the original state, that is to maintain the integrity of the flicker and the integrity of the waveform Sex.
  4. Especially important: When restarting the computer midway or shutting down the experiment after finishing the experiment, you must download another program to the experiment board, such as experiment two marquee; or run the FlyMCU on the desktop and click the clear chip function. Otherwise, the mouse may not work properly after restarting the computer.

3 Experimental code

[exti.c]

int isKEY0=<

Guess you like

Origin blog.csdn.net/qq_44714521/article/details/108705160