Keil macro definition and how to know the microcontroller resource name

Publisher:夜色迷离Latest update time:2019-04-18 Source: eefocusKeywords:Keil Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In Keil's project settings, you need to change the macro definition according to the selected microcontroller. If the macro definition is not changed after the program is transplanted, an error may sometimes be reported.




This macro definition represents the type of chip, as follows:

Therefore, you need to change the macro definition according to the type of your chip.


How do I know the resource names of my chip? For example, what is the name of the timer?


You can open the stm32f10x.h file and scroll down to see:


These macros represent:


STM32F10X_LD_VL corresponds to LowDensity ValueLine, i.e. the small capacity STM32F100

STM32F10X_MD_VL corresponds to MediumDensity ValueLine, i.e. the medium-density STM32F100

STM32F10X_HD_VL corresponds to HighDensity ValueLine, i.e. the large capacity STM32F100

STM32F10X_CL corresponds to ConnectivityLine, i.e. STM32F105, STM32F107

In fact, the more commonly used one is STM32F103:

STM32F10X_LD corresponds to LowDensity, i.e. small capacity STM32F103, 101

STM32F10X_MD corresponds to MediumDensity, which is the medium-density STM32F103, 101

STM32F10X_HD corresponds to HighDensity, i.e. the large capacity STM32F103, 101


For example, the chip is STM32F103C8T6, the flash is 64K, which is a medium-capacity STM32F103, that is, STM32F10X_MD, so it corresponds to the following in the stm32f10x.h file:


It can be seen that the chip has three ordinary timers, TIM2, TIM3, and TIM4, one advanced timer, TIM1, and three serial ports. . .


Keywords:Keil Reference address:Keil macro definition and how to know the microcontroller resource name

Previous article:Keil code overall offset and search function
Next article:Keil Chinese garbled code solution and personal font setting

Recommended ReadingLatest update time:2024-11-16 16:49

stm32 keil4 build project
After installing Keil vision4 and configuring the MDK simulation environment, we start to build the project! 1. New construction project 1. Create a TEST folder on the desktop and create the following folders in the folder; 2. Start Keil v4, create our project file, name it STM-DEMO, and save it in the folder
[Microcontroller]
stm32 keil4 build project
Problems with Keil's code optimization
After reading an article titled "Keil C51's method of continuously reading the same port" (original text) in the "Experience Exchange" column of "Microcontroller and Embedded System Application" magazine, issue 10, 2005, the author believes that the article does not provide an in-depth and accurate analysis of this iss
[Microcontroller]
There are several common warnings in keil. How many have you encountered?
There are several common warnings in Keil. Of course, compared with errors, the degree of warning is not as serious as the error. Sometimes, if you ignore it, unexpected errors will occur. Let's take a look at several common errors and analyze the reasons for them. 1. Warning 280:’i’:unreferenced local variable Ex
[Microcontroller]
How to use Keil C to implement the interrupt function of microcontroller
Direct access to registers and ports  definition sfr P0 0x80 sfr P1 0x81 sfr ADCON; 0xDE sbit EA 0x9F operate ADCON = 0x08;   P1 = 0xFF;    io_status = P0 ; EA = 1;            After using the interrupt 1 keyword, an interrupt vector is automatically generated.         You cannot share local variables in an ISR with o
[Microcontroller]
How does keil c51 start the c program?
Assembly starts from org 0000h, so how does keil c51 start the main() function? keil c51 has a startup program startup.a51, which is always compiled and linked with the c program. Let’s see how it and the main() function are compiled;   //The main function is as follows; void main(void) { while (1) This is an uncondit
[Microcontroller]
KEIL's C compiler does not support writing binary numbers
When writing 51 assembly programs with KEIL, you can use binary numbers followed by "B", for example 0x2A = 00101010B. However, KEIL's C compiler does not support writing binary numbers, so KEIL's C programs cannot be directly expressed in binary numbers.
[Microcontroller]
MCU Development Environment Construction--Keil uVision4 Installation Tutorial
The two most important software for microcontroller development are programming software and downloading software. We use the 51 version of Keil uVision4, also called Keil C51, for programming software. Without further introduction, let's talk about how to install it. 1) First prepare the Keil uVision4 installation so
[Microcontroller]
MCU Development Environment Construction--Keil uVision4 Installation Tutorial
51 MCU tutorial: key input, matrix key (key usage) proteus simulation + keil
IO port principle (P1 port is the simplest, so only P1 is introduced here, the principles of other IO ports are similar) P1 port principle It can be seen that the working principle of P1 port is relatively simple. It is easier to understand using P1 port for input and output. 1. Internal bus: It is the value of the
[Microcontroller]
51 MCU tutorial: key input, matrix key (key usage) proteus simulation + keil
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号