没有合适的资源?快使用搜索试试~ 我知道了~
KEIL软件仿真时硬件DLL设计
需积分: 46 17 下载量 144 浏览量
2017-10-31
11:31:23
上传
评论 2
收藏 310KB PDF 举报
温馨提示
试读
62页
在KEIL5 中,可以DIY自己的或者市场上应用的任何硬件平台在KEIL中进行软件仿真
资源推荐
资源详情
资源评论
Implementing µVision DLL’s for Advanced Generic Simulator Interface Page 1 of 62
C Compilers • Real-Time OS • Simulators • Education • Evaluation Boards
Implementing µVision DLL’s for Application Note 154
Advanced Generic Simulator Interface Rev. 4
Extended by Infineon Technologies
Contents
Contents ..................................................................................................................................................... 1
Introduction.................................................................................................................................................3
How to use a Sample Peripheral DLL ........................................................................................................ 4
Implementing own peripheral DLLs: Required Steps ................................................................................. 7
How simulation basically works .................................................................................................................. 8
Address representation .............................................................................................................................. 9
AGSI Function Description .......................................................................................................................10
AgsiEntry............................................................................................................................................... 11
AgsiDefineSFR .....................................................................................................................................13
AgsiDefineVTR .....................................................................................................................................14
AgsiDeclareInterrupt .............................................................................................................................15
AgsiSetWatchOnSFR ...........................................................................................................................17
AgsiSetWatchOnVTR ...........................................................................................................................18
AgsiSetWatchOnMemory......................................................................................................................19
AgsiCreateTimer ................................................................................................................................... 20
AgsiSetTimer ........................................................................................................................................21
AgsiDefineMenuItem.............................................................................................................................22
AgsiRegisterExecCallBack ................................................................................................................... 24
AgsiWriteSFR .......................................................................................................................................25
AgsiReadSFR .......................................................................................................................................26
AgsiSetSFRReadValue.........................................................................................................................27
AgsiWriteVTR .......................................................................................................................................28
AgsiReadVTR .......................................................................................................................................29
AgsiWriteMemory..................................................................................................................................30
AgsiReadMemory .................................................................................................................................31
AgsiGetStates .......................................................................................................................................32
AgsiGetProgramCounter....................................................................................................................... 33
AgsiIsInInterrupt....................................................................................................................................34
AgsiIsSleeping ......................................................................................................................................35
AgsiIsSimulatorAccess .........................................................................................................................36
AgsiIsSyncInstruction............................................................................................................................37
AgsiGetSyncCount................................................................................................................................ 38
AgsiSetSyncCount ................................................................................................................................ 39
AgsiSetSyncDelay ................................................................................................................................40
AgsiStopSimulator ................................................................................................................................41
AgsiWakeUp .........................................................................................................................................42
AgsiTriggerReset ..................................................................................................................................43
AgsiContinue.........................................................................................................................................44
AgsiRequestInterrupt ............................................................................................................................45
AgsiSetSyncCount ................................................................................................................................ 46
AgsiUpdateWindows.............................................................................................................................47
AgsiHandleFocus..................................................................................................................................48
Implementing µVision DLL’s for Advanced Generic Simulator Interface Page 2 of 62
AgsiGetExternalClockRate ................................................................................................................... 49
AgsiSetExternalClockRate.................................................................................................................... 50
AgsiGetInternalClockRate.....................................................................................................................51
AgsiGetClockFactor .............................................................................................................................. 52
AgsiMessage ........................................................................................................................................53
AgsiSetTargetKey ................................................................................................................................. 54
AgsiGetTargetKey.................................................................................................................................55
AgsiExecuteCommand .........................................................................................................................56
AgsiGetLastMemoryAddress ................................................................................................................ 57
AgsiGetSymbolByName .......................................................................................................................58
AgsiGetSymbolByValue........................................................................................................................ 59
Extensions by Infineon Technologies .......................................................................................................61
Index......................................................................................................................................................... 62
Implementing µVision DLL’s for Advanced Generic Simulator Interface Page 3 of 62
Introduction
The µVision Debugger supports a simulator interface for implementing user-defined peripherals. This
interface is called Advanced Generic Simulator Interface (AGSI). The AGSI introduces a flexible and
easy way for adding new user defined peripherals directly to µVision. It provides functions that are
necessary to simulate the peripheral’s behavior as well as functions to display peripheral dialogs.
To ease the development of a user-defined peripheral, the AGSI and a configuration framework is
provided in two example projects. Only µVision version 2.21 or later supports all functions that are
described in this document.
AGSI Revision 3 is for µVision3 (version 3.00 or higher) and adds the following features:
• AgsiEntry has new function codes (nCODE= AGSI_PRE_RESET, AGSI_CMDOUT)
• The CALLBACK function for AgsiSetWatchOnSFR, AgsiSetWatchOnVTR, and
AgsiSetWatchOnMemory gets now the address and access reason when it is called.
AGSI DLL’s that have been developed for µVision2 can still be used with µVision3.
SPeriDLL
SPeriDLL, is a synonym for ‘Sample Peripheral DLL’. It is a ready to run peripheral DLL which
implements a ‘A/D Converter from Analog Devices ADuC812’ as a sample peripheral. It uses most of the
AGSI functions to implement this peripheral. The project consists of a MS Visual-C++ (6.0) project file
and the following source files:
AGSI.h: prototypes for the AGSI functions (do not modify!)
SPeriDLL.h: main header file with various prototypes and definitions
SPeriDLL.cpp: main file (created by AppWizard) contains setup code and simulation
PeriDialog.h: header file (created by Class Wizard) for a modeless peripheral dialog
PeriDialog.cpp: implementation file for a modeless peripheral dialog
Also a simple µVision test project ‘Single A/D conversion with ADuC812’ is included in the file
S812ADC.zip which shows how to include and test the implemented peripheral.
STimerDLL
STimerDLL, is a synonym for ‘Sample Timer DLL’. It is a ready to run peripheral DLL which implements
a ‘Timer 3’ as a sample peripheral. As regards functionality, ‘Timer 3’ is identical to a standard 8051
Timer 1 but has different SFR addresses so that it can be loaded in addition to a ‘Timer 1’. It uses most
of the AGSI functions to implement this peripheral. The project consists of a MS Visual-C++ (6.0) project
file and the following source files:
AGSI.h: prototypes for the AGSI functions (do not modify!)
Common.h: header file with various prototypes and definitions
Common.cpp: common support functions for AGSI and dialog functions
STimerDLL.h: header file for STimerDLL class
STimerDLL.cpp: main file provides peripheral setup code and simulation
PeriDialog.h: header file (created by Class Wizard) for a modeless peripheral dialog
PeriDialog.cpp: implementation file for a modeless peripheral dialog
Also a simple µVision test project is included in the file Timer3.zip which shows how to include and test
the implemented peripheral.
In order to develop a peripheral, knowledge about C/C++ programming and the MS Visual-C++ 6.00
Programming Environment is required.
Implementing µVision DLL’s for Advanced Generic Simulator Interface Page 4 of 62
How to use a Sample Peripheral DLL
In order to use one of the Sample Peripheral DLL’s, you must perform the steps below. The following
steps are described for the SPeriDLL but the same applies for the STimerDLL:
• Install µVision and the C51 Compiler on your PC.
• Create a folder such as D:\Src32\SPeriDLL\
• Unzip the file SPeriDLL.zip into the folder. Make sure that the ‘use folder names’ checkbox is
checked since SPeriDLL uses some subfolders.
• Create a folder such as C:\Keil\C51\Examples\S812ADC\
• Unzip the file S812ADC.zip into the folder.
• Start Visual-C, select the ‘SPeriDLL.dsw’ project file.
• Select ‘Project – Settings’. Click at the ‘Debug’ tab. Browse for the ‘Executable for Debug
session’. You need to select the file Uv2.Exe. It is normally in C:\Keil\Uv2 but this depends on
where you have installed µVision.
• Then click at the ‘Custom Build’ tab and write in the ‘Commands’ window the command ‘copy
$(InputPath) C:\KEIL\C51\BIN\$(InputName).dll’ and write in the ‘Outputs’ window the output
file ‘C:\KEIL\C51\BIN\$(InputName).dll’. This step is required to automatically copy the created
DLL after building it in the BIN subfolder of µVision which is normally C:\KEIL\C51\BIN but
depends on where you have installed µVision. If everything is right, then the dialog should look
like this:
• After that, close the dialog.
Implementing µVision DLL’s for Advanced Generic Simulator Interface Page 5 of 62
• Select ‘Build – Set active configuration’, choose the SPeriDLL Win32 Debug configuration.
• Select ‘Build – Rebuild All’ to create the DLL.
• Run µVision by pressing the F5 key. Select ‘Project – Open Project’, the Select Project dialog
comes up. Select the ‘S812ADC.uv2’ project. It can be found in the folder that you have
created and copied the project files into (normally C:\Keil\C51\Examples\S812ADC).
• Select ‘Rebuild all target files’ to build the project.
• Select ‘Options for Target – Debug’. Enable loading of the SPeriDLL peripheral DLL by simply
adding the parameter ‘-dSPeriDLL’ to the parameter list of the ‘Dialog DLL’. The parameter
format for peripheral DLL’s is ‘-dDLLName’ (DLL name without extension). Make sure that the
‘Use Simulator’ radio button is checked. If everything is right, then the dialog should look like
this:
• Close the dialog.
剩余61页未读,继续阅读
资源评论
linhe1992
- 粉丝: 5
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2001~2022年上市公司数字赋能指数.dta
- 2001~2022年上市公司数字赋能指数.xlsx
- 信息办公石大在线财务管理系统(含源码)-shidacaiwu.rar
- 信息办公电信计费系统完整代码-netctossconformity.rar
- matlab实现TD-SCDMA中初始同步捕捉DwPTS下行同步导频时隙的仿真.zip
- 信息办公玉玺学生信息管理系统-webapps.rar
- 信息办公基于struts的图书管理系统-struts-ts.rar
- 管家婆分销ERP V1 V3 A8II TOP V10.0.2最新全版本通用
- 信息办公基于Ajax+J2EE的MicroERP源码下载-microerp-0.1.rar
- 信息办公双鱼林jsp人事工资系统-wagesmanagesystem.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功