Article Source Address: http://blog.sina.com.cn/s/blog_dc9244010102vtn1.htmlRecently in the study of STM32 PWM output, because the hands do not have an oscilloscope, so in accordance with the Wildfire tutorial using software simulation, using MDK5 Logic Analyzer to observe the waveform, the front all the way smoothly, in the logic Analyzer to open the Add Signal, the problem occurred--unknown signal! The signal cannot be added in. In the Baidu Library to see a MDK460 related problems of the solu
change it? So to speak: at any time, you don't need to change startup.a51, if you understand its characteristics. Below is a detailed explanation: 1. Label Idatalen equ 80h ; The length of IDATA memory in bytes. Here Idatalen is just a label, and IDATA is not the same thing! If you want to, this procedure in the idatalen you can change to dog ah, pig ah, playboy ah these markings (in fact, my ideal is the life of pigs, not worry about eating and drinking, carefree, but can not do), The above s
The target configuration diagram for the options for target and the scatter file for the project file.When we modify the address in read/only memory areas and read/write memory areas in target, the address in the scatter file is automatically changed after compiling the project file.To observe the relationship between the two, it is not difficult to find that the starting address and size in the read/only memory areas correspond to the load address of the image file in the scatter file and the s
Background: The code accumulated more, everyone may have tried to write a library, convenient to call, my initial approach is to put the usual functions into one. c file inside, to use when you put a. C added to the group inside, this method is very troublesome, each new project will add half a day.Objective: To write some functions into the form of a library file, to the form of a header file function interface, so that other projects can be called directly.1, the new 1
Source: KEIL MDK View Code volume, Ram usage--ro-data, Rw-data, zi-data explanationKEIL RVMDK Post-compilation informationProgram size:code=86496 ro-data=9064 rw-data=1452 zi-data=16116Code is the amount of space that is consumed by the codes;Ro-data is the size of Read only read-only constant, such as const type;Rw-data is the size of the read-write variable that was initialized;Zi-data is the size of a read-write variable (Zero Initialize) that is n
gprs_send_buff[index++]=stdev.sn>>24+ (gprs_send_buff[4]%4);gprs_send_buff[index++]=stdev.sn>>16+ (gprs_send_buff[4]%4);gprs_send_buff[index++]=stdev.sn>>8+ (gprs_send_buff[4]%4);gprs_send_buff[index++]=stdev.sn+ (gprs_send_buff[4]%4);Out of the results always in my unexpected, tossing half an hour to find out, is the algorithm out of the question,Priority judgment exceeded unexpected.Before learning C language when not how to remember the priority, just remind yourself when programming can not
printf in 8.debug.c.#ifdef __gnuc__#definePutchar_prototype int __io_putchar (int ch)/* with gcc/raisonance, small printf (option LD Linker->libraries->small printf set to ' Yes ') calls __io_putchar () */#else #definePutchar_prototype int FPUTC (int ch, FILE *f)#endif/* __gnuc__ */putchar_prototype{BYTE C=(BYTE) ch; if(DEMCR Trcena) { while(Itm_port32 (0) ==0) {} itm_port8 (0) =C; } returnch;}9. Switch to SW mode10. Set the clock according to the processor and open ITM Port 011.
Keil some function keys do not have the default shortcut keys, if commonly used, more convenient approach is to set it into their own habit of shortcut keys.
Here's how to customize shortcut keys:
1. Find the location of the function you want to define, such as I want to define "Comment Selection" annotation Select the target function, find its location:Edit:Advanced:Comment Selection;
2. Select edit:configuration, configuration options;
3. Select
In the Keil installation directory, where there are STDIO.H several print functions are as follows:
extern int printf (const char *, ...);
extern int sprintf (char *, const char *, ...);
extern int vprintf (const char *, char *);
extern int vsprintf (char *, const char *, char *);
vprintf corresponds to printf, which prints the data in ASCII format to the serial port
The vsprintf corresponds to sprintf, which prints the data in ASCII format to
Download Keil MDK5 After the device is not installed, if the creation of the project will not find the target chip, as shown in the following figure:
At this point we will install the chip series we need, such as the STM32F1 series.
First select Project-manage-pack installer as shown in the following figure:
At this point, the following interface appears:
Select Packs in the menu bar, click Check for Updates, the latest supported CPU series
compile.
Our main function in the previous chapter is that the LEDs driven by the P0 port blink at a frequency of 1Hz. The timer is used, as well as the LED driver module. As a result, we can easily divide the entire project into three modules, timer modules, LED modules, and main functions
The corresponding file relationships are as follows
Main.c
TIMER.C--? Timer.h
LED.C--? Led.h
Before we start rewriting our program, let's talk about how to create a project template in
Use MDK to create a stm32f103ze core project yourselfAdd the source code after compiling, normal, online simulation single-step implementation of the following problemsError 65:access violation at 0x40021000:no ' read ' permissionI found a problem with the setup inside Debug.http://www.cnblogs.com/xiaobo-Linux/The main items are the following 2 settingsDialog DLL Default is DCM3.DLLParameter default is-PCM3should readDialog DLL Default is DARMSTM.DLLParameter default is-pstm32f103zeIt's normal.S
1.xdata means that this is the data in an external RAM address, and the data will eventually be saved to an address cell in the external RAM;However, external RAM can only be accessed through register indirection, that is, its address needs to be stored in internal RAM (in fact, perhaps SFR, 8-bit addresses are generally R0, r1,16 addresses are generally dptr)Here, the content stored in the dptr is equivalent to pointers to external RAM units ... So, a pointer to an internal data type, and an ex
1. The process of the new project is unchanged, the selection of the chip, but in the new file is the. asm suffix2. Once the assembler is complete, place it in a folder and then right-click on the project to generate the hex file3. Then press the Debug button4. Step Execution (step button), you can see the changes on the right side of the PSW,R0-R7,A,B,PC, you can choose the Memory tab in the lower right corner, enter the storage space you want to see in address, you can see the changes in the c
The attachment shows the production method and the lcd1602 example, which includes video tutorials.
Keil CLib file generation method
Inclusion relationship
Lcd1602.cIncluding lcd1602.h
Lcd1602.hFile Format
Set to generate lib File
LIBFile call
Add lib file dialog box
Added lib File
Haha ^ _ ^. In this way, you can delete the file lcd16
has been using Keil to write some of the microcontroller program, but has not done some optimization of the project structure, and sometimes open the project after the document structure level more complex looks very uncomfortable, so here are some of my ideas:First, the structure of the file to be divided into bin Buil_keil include library lst obj source startup such directory, such asThis allows the generated. bin file to be placed down the bin. Wan
The basic steps for debugging the Keil program in internal RAM are already available on the Internet, so I will not repeat them here. You can find a lot on the Internet.
However, sometimes the internal RAM is not enough, so you need to load the program into the external RAM for debugging. In this process, various problems may occur, here, I will summarize some of the problems I have encountered and the areas that need attention, hoping to help you.
I read a lotArticleAnd writes are very simple (actually very simple :)). A detailed tutorial is provided.
1. Use vspd to connect two virtual serial ports on the PC. I connect com2 and com3. Click ADDR pair.
2. We can see that two virtual serial ports are connected together on virtual ports.
3. The virtual serial port is ready. First, you can directly enter the command for debugging. We open the Keil MDK and set it to the simulation m
killed, and only a few useful files are left. the total size is 232kb, much less than before. now, you can package the folder and send it to others, which can save a lot of traffic. it can also save space on your hard disk.What's amazing about. bat? You can use a text tool to open it as needed. BAT file, add or delete some statements in it to suit you. of course, the premise is that you are right. BAT must have a little understanding. specific Learning,HereFor more information, see. the flexibl
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.