1, first set up software simulation, you can see the STM32 not complete manual of the 2.4 software simulation chapter
(Original file name: 1.jpg)
Example functionality:
-Clock Settings:
-XTAL = 8.00 MHz
-SYSCLK = 72.00 MHz
-HCLK = SYSCLK = 72.00 MHz
-PCLK1 = HCLK/2 = 36.00 MHz
-PCLK2 = HCLK = 72.00 MHz
-ADCLK = PCLK2/6 = 12.00 MHz
-SYSTICK = HCLK/8 = 9.00 MHz
-TIM4 is running at 100Hz.
LEDs PB8, PB9 is dimmed using the PWM function of TIM4 channel3, Channel4
The Timer program was available in different targets:
Simulator:-configured for Software Simulator
MCBSTM32:-Runs from Internal Flash located on chip
(used for production or target debugging)
Second, select Software simulation
(Original file name: 2.jpg)
Third, compile the program, if the program is not wrong, will appear the following wireframe compilation information, and then go to debug, point out the Red "D" press, as shown in
(Original file name: 3.jpg)
Fourth step, the Software Logic Analyzer, and the waveform signal to be observed to pull into the logic Analyzer, if you enter the debug state without the "Sysbols" tab, click on the "View" menu pop out, from the "peripheral Register" to be observed (gpiob_ The PWM signal from the IDR output is reflected from this register) to the logic analysis, or directly to the portx.x pin view.
(Original file name: 4.jpg)
The fifth step, the unused bit is screened out, and is displayed in bit form, configuration
(Original file name: 5.jpg)
Sixth step, click "Go" button to enter full speed operation, OK,PWM waveform out, with in and out can be adjusted scan time, such as
(Original file name: 6.jpg)
Analysis of PWM wave at IO Port using Logic Analyzer in MDK4