没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
























1
AVR108: Setup and Use of the LPM Instruction
Features
• Use of the LPM (Load Program Memory) Instruction with the AVR
®
Assembler
• Load Constants from Program Memory
• Use of Lookup Tables
Introduction
This application note describes how to access constants saved in Flash Program
memory of the AVR microcontrollers. The AVR is based on a Harward architecture,
this means that Address and Data memory use separate busses. This is necessary to
achieve single cycle instructions execution speed. To be able to save constants in
Flash memory the Load Program Memory (LPM) instruction is included in the instruc-
tion set.
Use of the LPM
The LPM instruction is included in the AVR Instruction Set to load a data byte from the
FLASH Program memory into the Register File.
The Flash Program memory of the AVR microcontroller is organized as 16 bits words.
The Register File and SRAM Data memory are organized as eight bits bytes. Special
consideration must therefore be taken when loading data from Program memory to
Data meory.
The Z-register in the Register File is used to access the Program memory. This 16 bits
register pair is used as a 16 bits pointer to the Program memory. The 15 most signifi-
cant bits selects the word address in Program memory. Because of this, the word
address is multiplied by two before it is put in the Z-register.
Figure 1. Z Address Register
The least significant bit of the Z Address Register selects either Low byte (0) or High
byte(1) of the Program memory word. To calculate the Low (ZL) an High (ZH) part of
the address, use the LOW() and HIGH() functions.
To load data from random places in program memory, the Z-register must be set up
with the proper address each time a new address is accessed.
In Program memory the data is organized with one byte in the low part of a program
word and the next byte in the high part. Because of this, the message string will
appear as if every pair of characters has been swapped, when viewed in the memory
view in AVR Studio
®
.
15 8 7 1 0
Program Word Adress
Low/High
Byte Select
8-bit
Microcontroller
Application
Note
Rev. 1233B–AVR–05/02
资源评论


dongdaxing
- 粉丝: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- soybean-admin-Typescript资源
- 我持续更新的机器学习、概率模型与深度学习讲义及演示(2000 + 幻灯片)
- Admin.NET-C#资源
- thinkphp-PHP资源
- G6-JavaScript资源
- 七月在线深度学习面试 100 题学习整理
- Archery-SQL资源
- WeBlog-毕业设计资源
- 声纹检测帕金森患者识别系统-大创资源
- vcos_build-智能车资源
- Go Web编程实战派源码-C语言资源
- 借助多搜索引擎与深度学习技术的自动问答系统
- hikyuu-C++资源
- austin-Java资源
- Goldfish Scheme-Python资源
- Swift-Numerics-Swift资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
