The logic analysis provided by Keil is good

Publisher:琴弦悠扬Latest update time:2015-12-28 Source: eefocusKeywords:keil Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The software logic analyzer in Keil MDK has powerful functions, which can analyze digital signals, analog signals, CPU bus (UART, IIC and other output pins), and provide debugging function mechanism to generate custom signals, such as Sin, triangle wave, bath sound signal, etc., which can be defined.

    Take the built-in stm32 CPU in Keil as an example, track and observe the PWM waveform, open the stm32 Dome in the directory C:KeilARMBoardsKeilMCBSTM32PWM_2, the first step: perform simulation configuration, as shown in the figure:


The logic analysis provided by Keil is good
(Original file name: 1.jpg)
  
The Abstract.txt file in the open project contains the description of the project. PWM is output from PB0.8 and PB0.9. It will be added to the software logic analyzer later.

The 'PWM' project is a simple program for the STM32F103RBT6
using Keil 'MCBSTM32' Evaluation Board and demonstrating
the use of PWM (Pulse Width Modulation) with Timer TIM4 .

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 are dimmed using the PWM function of TIM4 channel3, channel4

The Timer program is 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

The logic analysis provided by Keil is good
(Original file name: 2.jpg)
 
Third, compile the program. If the program is correct, the following wireframe compilation information will appear. Then enter the debug mode and click the red "D" button, as shown in the figure below.

The logic analysis provided by Keil is good
(Original file name: 3.jpg)
 
Step 4. Open the software logic analyzer and drag the waveform signal to be observed into the logic analyzer. If there is no "sysbols" label in the debugging state, click the "View" menu to pop up, and drag the signal to be observed from the "Peripheral Register" (the PWM signal output by GPIOB_IDR will be reflected from this register) into the logic analyzer.


The logic analysis provided by Keil is good
(Original file name: 4.jpg)
 
Step 5: Shield the unused bits and display them in bit form. The configuration is shown in the figure

The logic analysis provided by Keil is good
(Original file name: 5.jpg)
 
Step 6. Click the "GO" button to enter full-speed operation. OK, the PWM waveform appears. Use IN and OUT to adjust the scan time, as shown below.


The logic analysis provided by Keil is good
(Original file name: 6.jpg)
 
Keywords:keil Reference address:The logic analysis provided by Keil is good

Previous article:C language "right shift >> and left shift <<" in single chip microcomputer and CY
Next article:Solution to the problem that two PIT interrupts of the microcontroller cannot run at the same time

Recommended ReadingLatest update time:2024-11-15 14:27

How to use Keil to verify how many bytes a microcontroller variable occupies
Let me first ask you two questions: An 8-bit microcontroller defines an int type variable. How many bytes does it occupy? A 32-bit microcontroller defines a char type variable. How many bytes does it occupy? I dare say that many people don’t know or have doubts. The specific number of bytes occupied can actually be kn
[Microcontroller]
Keil5.24 creates uCOSIII project to implement stm32 real-time operating system (environment configuration)
Since ARM Keil was upgraded to Keil5 series, Keil tools have greatly simplified the porting of operating systems and various library files. You can complete the transplantation work by just moving your fingers and checking some library files. 1: Assume that you have installed Keil 5.24 (earlier versions support fewer
[Microcontroller]
Keil5.24 creates uCOSIII project to implement stm32 real-time operating system (environment configuration)
What is the difference between keil5 and keil5 mdk?
From Keil C51 to Keil5 MDK, I have been using Keil for more than ten years without realizing it. Although some new development environments have been added now, Keil should be the most friendly to veteran engineers... Keil has released many versions, and many people are most familiar with Keil C51 and Keil5 MDK. Whe
[Microcontroller]
STM32 transplantation based on keil contiki system
1. File status of all codes Second, the file inclusion situation in keil 3. Modification of source files 1. Contiki-2.5 (based on this version of the kernel), modify the function in the clock.c file under the cpu/arm/stm32f103 folder void clock_init() { if (SysTick_Config(SystemCoreClock /CLOCK_SECOND))  {     
[Microcontroller]
The relationship between KEIL and standard C and programming methods
One of the keys to learning C51 is to deeply understand and apply the extensions of C51 to standard ANS ICs . This is because most of the extensions are directly targeted at the 8051 series CPU hardware. There are roughly 8 categories: 8051 storage types and storage areas l; Storage mode l Memory type declaration l V
[Microcontroller]
Solution to using printf function in Keil MDK environment
The printf() function can directly format the output to the window, which greatly facilitates our debugging of the program. However, in the Keil MDK environment, directly using the printf() function will fall into a software interrupt, resulting in an infinite loop; therefore, the main() function cannot be entered. Wh
[Microcontroller]
The role of startup.a51 in Keil C
Startup file. Clean up RAM. Set up stack, etc. After executing start.a51, jump to the main function of the .c file. Just like assembly, the variables and arrays defined in C are initialized in startup.a51. If you define a global variable with a value, such as unsigned char data xxx="100";, then startup.a51 will have a
[Microcontroller]
KEIL, a Smart Comliler
  KEIL is a great compiler. Here are a few examples:   1. The compiler displays WARNING "expression with possibly no effect" to remind you that the current statement is doing useless work, such as the following statement in the preprocessor: #define S2TB8(a)  ((S2CON & 0xf7) | (a) 3 )   The solution is as follows: mod
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号