IAR for AVR Study Notes (2) -- Extended Keywords

Publisher:耿高良Latest update time:2016-08-18 Source: eefocusKeywords:IAR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
It can be used to solve the storage of data and functions. With it, we can define variables and store them in EEPROM and FLASH space. Define interrupt functions, pointers, etc. There are many IAR keywords, and only the commonly used ones are listed here.

2.1. Extended keywords: used to control data and pointers.
__eeprom is used for EEPROM storage space, controls data storage, controls pointer type and storage
__tinyflash, __flash, __farflash, __hugeflash are used for flash storage space, controls data storage, controls pointer type and storage:
__ext_io, __io are used for I/O storage space, controls data storage, controls pointer type and storage
__regvar places a variable in a working register

2.2. Function extension keywords:
__nearfunc __farfunc are used to control data storage. This group of keywords must be specified when declaring and defining the function:
__interrupt. Keywords control the type of the function. This group of keywords must be specified when declaring and defining the function
. __root. Keywords only control defined functions:

2.3. Other special keywords:
@ is used to locate the absolute address of the variable. You can also use the #pragma location command
#pragma vector to provide the entry address of the interrupt function.
__root ensures that unused functions or variables can also be included in the target code
__no_init prohibits initialization of variables when the system starts. 
asm, __asm ​​insert assembly code
Keywords:IAR Reference address:IAR for AVR Study Notes (2) -- Extended Keywords

Previous article:IAR for AVR Learning Notes (3) - Bit Operations
Next article:IAR for AVR Study Notes (1) -- Data Types

Recommended ReadingLatest update time:2024-11-23 13:43

How to open project files if IAR version is incompatible
I have been using IAR for several years, from the initial IAR for AVR to IAR for MSP430, and now IAR for arm. Although I cannot say that I am very proficient in it, I am indeed very comfortable with it and I have a lot of feelings for it. I often see people who are new to ARM asking whether MDK for ARM or IAR for ARM
[Microcontroller]
How to open project files if IAR version is incompatible
Application of Dual-Port RAM in the Design of PCI Bus and AVR Interface
Since the PCI bus operates at a frequency of 33 MHz and the AVR microcontroller operates at 16 MHz, their clocks are not synchronized. To achieve effective communication, a data buffer must be set between them as a unit for exchanging data between the two parties. The dual-port RAM solves this problem. It serves as bot
[Microcontroller]
Application of Dual-Port RAM in the Design of PCI Bus and AVR Interface
AVR microcontroller controls LCD1602 liquid crystal display
1. Introduction of Character LCD1602 For more details, please visit: http://q.163.com/longfei-mcu/ Above is a picture of LCD1602, which is used by most on the market. LCD1602 is very common. Most of the character LCDs on the market are based on HD44780 LCD chips. The control principle is exactly the same. Theref
[Microcontroller]
AVR microcontroller controls LCD1602 liquid crystal display
Study on the Stability of the Internal RC Oscillator and Bandgap Voltage Reference of AVR Microcontroller
After repeatedly studying the stability of the internal RC  oscillator  and bandgap voltage reference of MEGA 48, I chose MEGA 48 and used the internal RC to drive the serial port communication. It has been quite successful! Suddenly a few days ago, I found that the software that could communicate normally last time
[Microcontroller]
12864 LCD (AVR_Mega128) header file
When you use it, save this code as a .h header file and include this header file in the main program.   Just change the following port macro definition according to your LCD circuit       //CPU:ATmega128; clock frequency is 16MHz //Compilation environment is ICCAVR //head File #include iom128v.h #inc
[Microcontroller]
AVR--IO structure analysis
The following figure is a basic structure diagram of the general I/O port of the AVR microcontroller. As can be seen from the figure, each I/O port is equipped with three 8-bit registers, which are the direction control register DDRx, the data register PORTx, and the input pin register PINx (x=ABCD). The working mode
[Microcontroller]
AVR--IO structure analysis
How to observe the value of local variables through the Watch window in IAR
I recently developed a product using 430. When debugging the software, I found that I could not observe the value of local variables in the Watch window. It always displays. The following is a simple example to illustrate the phenomenon: #include "msp430g2553.h"/* Global variable */unsigned char ReceiveGlobal;unsigned
[Microcontroller]
How to observe the value of local variables through the Watch window in IAR
AVR serial port sending program
 ATMega32 Frequency: 8.0MHz Compiler: CodeVisionAVR 1.24.8c   Serial port sending program */ #i nclude mega32.h #i nclude delay.h #i nclude stdio.h #define uchar unsigned char // 0~255 #define uint unsigned int     // 0~65535     #define _SPK            PORTB.2 #define _LED            PORTB.3 #define C
[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号