Keil C编译器的使用与DS89C430/450

abstract: this application note describes how to use the keil uvision suite of tools to build a c application for the ultra-high-speed flash family of microcontrollers, which includes the ds89c430 and the ds89c450. the process of loading the compiled application into the using dallas semiconductor's microcontroller tool kit (mtk) application is also covered.
overviewthis application note describes how to use the keil µvision2™ suite of tools to build a c application for the ultra-high-speed flash family of microcontrollers, which includes the ds89c430, the ds89c440, and the ds89c450. the process of loading the compiled application into the microcontroller using dallas/maxim's microcontroller tool kit application is also covered. all development for this application note was done using the ds89c440 and the high-speed microcontroller evaluation kit board (rev b). the c application was created and compiled using keil's µvision2 version 2.40 and the keil c51 compiler version 7.10. the compiled application was loaded into the ds89c440 flash memory using the microcontroller tool kit version 2.1.03. notes on the ultra-high speed flash microcontroller familythe microcontrollers in the ultra-high speed flash family are all programmed identically, with the same register set and memory mapping. the only difference between them is in the amount of internal flash memory they have, which is as follows.
ds89c430 — 16 kb x 8 ds89c440 — 32 kb x 8 ds89c450 — 64 kb x 8 creating and compiling the c applicationthis section describes the process to create and compile a hello world style application for the ds89c430/440/450 using keil's µvision2 integrated development environment. creating a new project
in keil µvision2, select project -> create new project from the menu. enter the name of your new project. the select device for target dialog will appear as shown below in figure 1. under database, select dallas semiconductor and the particular microcontroller you are using (the ds89c430, ds89c440, or ds89c450). hit ok to continue.
figure 1. selecting the device for a new keil µvision2 project. a new dialog box will ask, copy 8051 startup code to project folder and add file to project? select yes. setting project options
when the project window opens on the left, open up target 1. right click on target 1, and select options for target 'target 1'. an option dialog box will appear. select the target tab. change the settings in this tab as follows.
memory model — set to large: variables in xdata. this tells the compiler to locate variables in external movx ram. this is appropriate when using a hardware setup, such as the high-speed microcontroller evaluation kit, which provides external data memory for the ds89c430/440/450. code rom size — set to large: 64k program. set the checkbox for use on-chip rom (0x0000 to 0x7fff). this tells the compiler that we will be placing program code in the on-chip flash memory. set the checkbox for use multiple dptr registers. in the off-chip xdata memory section of the dialog, set the top two fields to ram start: 0x8000 and ram size: 0x7fff.
figure 2. target option settings for the ds89c430/440/450. next, select the output tab. set the checkbox for create hex file. this hex file will be required to load the project code into the microcontroller using the microcontroller tool kit. adding the project code open a new file and enter the following c code:
#include #include // initialize serial port 0 to 14400 baud (16.384mhz crystal) serialinit() { tmod = 0x21; // timer 1: 8-bit autoreload from th1 th1 = 220; // 14400 baud rate ckmod = 0x38; // use system clock for timer inputs t2con = 0x00; // serial 0 runs off timer 1 overflow tcon = 0x50; // enable timers 0 and 1 scon0 = 0x50; // enable serial port 0 sbuf0 = ' '; } void main() { serialinit(); // initialize serial port 0 printf(\r hello from the keil c51 compiler\r ); while (1) { ; // endless loop } } save this file as main.c. the file will not be automatically added to the project. to add the file, right-click on source group 1 and select add files to group 'source group 1'. select main.c and click add, then click close. compiling and loading the project
to compile the project, press f7, or select project -> build target from the menu. if no errors occur, messages should appear indicating that compilation completed successfully, as shown in figure 3.
figure 3. compilation output from keil µvision. the microcontroller tool kit software is available from the maxim/dallas website at www.maxim-ic.com. once the microcontroller tool kit software is installed, open it. in the initial dialog box, select the device type you are using (ds89c430, ds89c440, or ds89c450). next, select options -> configure serial port from the menu. select the serial port that you are using to connect to the microcontroller system (such as com1, com2...) and select a baud rate of 14400 baud. power on the high-speed microcontroller evaluation kit board at this point. the board should be set up as follows.
serial cable connected from pc com port to db9 connector j2 (serial0/loader) dip switches sw1.1-3 and sw4.1-2 should be on; all other dip switches should be off. in the microcontroller tool kit window, select target -> open com1 at 14400 baud from the menu (or press ctrl+shift+o). next, select target -> connect to loader from the menu (or press ctrl+l). a loader banner should appear, as shown below in figure 4. at the loader prompt, type 'k' and press enter. this erases the flash memory on the ds89c430/440/450. next, select file -> load flash from the menu (or press ctrl+o). select the .hex file from your project's compiled output and click open in the dialog box. a loading file...load complete message should appear. at this point, simply turn off dip switch sw4.1 to exit loader mode, and the application should execute and display the demonstration message over serial 0, which will be displayed in the microcontroller tool kit window.
figure 4. loading and running the application in mtk.

AMD股票年增79.6% NVIDIA成同期标普500中最差的一只股票
远景AESC计划在英国新建超级电池工厂
用LCD显示屏给手机进行充电?这是什么黑科技
新型耐压测试系统研究
5G时代需防范网络攻击,车联网或最先遭难
Keil C编译器的使用与DS89C430/450
开发者致力于WP版YouTube应用开发,以恢复原生访问
智慧消防物联网在社会中发挥着什么样的作用
NEC公司利用IoT物联网技术进行了货运车辆位置跟踪实验
新产品如何选型 NAND Flash?
新型微机械加工为微器件开辟新应用领域
电子技术基本概念与术语
第一版本5G国际标准的商用系统设备有望年底推出
Java和c语言间的差距,谁更有优势
Prestera 交换机为网络提供了嵌入式保护?
扫地机语音芯片ic,智能家居语音交互方案,唯创知音WTV380-8S
北汽新能源携六款产品盛大亮相 未来的市场表现值得期待
【技术专栏】泰凌微电子JTAG工具使用教程(二)
耦合式无电收音机diy教程
一名.net程序员的Java学习之路