keil 使用笔记:在Memory窗口上输入address_type:address才能看到正确地址的变量debug~perfermance analyzer加入要察看的模块名称,然后view~perfermance analyzer window 可以察看各个模块运行时间①Display address_type:address B:Bit address C:Code Memory Bx:Code Bank D D:80H 命令可以查看特殊寄存器 data D I:0 命令可以查看内部RAM数据iData; D X:0 命令可以查看外部RAM数据xData; ②R1 //显示R1 register ~R1 //显示变量R1 R1 = R7 //对寄存器Rx操作R1 = --R7 R1 = 0x20 ③main //显示main()的开始地址d main //显示main()的代码④向RAM.ROM中写数据Enter data_type address_type:address expr,expr.... data_type:int char double float long E char data:0x20 1,2,3,4 //向data区0x20开始的地址写1,2,3,4 变量放在RAM的30H,要把定义放在main前面!另外特别注意,内部RAM通常供C程序存放中间变量等,所以一定要看看编译后的程序中是否存在存储单元冲突的情况,比如如果程序中 使用了别的寄存器组的话,08-1FH单元就不能用了unsigned long data i _at_ 0x30
上传时间: 2013-11-05
上传用户:dongqiangqiang
这一颗,我们学习如何让跑马灯自动按照我们预定的顺序进行。这种控制在工控场合经常用到。这个程序里,我们预先定义了一个变化的顺序speedcode,每跑一圈灯就根据预定设置的表格数据来决定下一圈的跑马速度。这样我们就实现了按照预定的顺序自动变化运行。请看代码:-----------------------------------#define uchar unsigned char //定义一下方便使用#define uint unsigned int#define ulong unsigned long#include <reg52.h> //包括一个52 标准内核的头文件sbit P10 = P1^0; //头文件中没有定义的IO 就要自己来定义了sbit P11 = P1^1;sbit P12 = P1^2;sbit P13 = P1^3;bit ldelay=0; //长定时溢出标记,预置是0uchar speed=10; //设置一个变量保存跑马灯的移动速度uchar code speedcode[10]={3,1,5,12,3,20,2,10,1,4}; //10 个预定义的速度char code dx516[3] _at_ 0x003b;//这是为了仿真设置的//可编程自动控制跑马灯void main(void) // 主程序{uchar code ledp[4]={0xfe,0xfd,0xfb,0xf7};//预定的写入P1 的值uchar ledi; //用来指示显示顺序uchar i;RCAP2H =0x10; //赋T2 的预置值0x1000,溢出30 次就是1 秒钟RCAP2L =0x00;TR2=1; //启动定时器ET2=1; //打开定时器2 中断EA=1; //打开总中断
上传时间: 2013-11-20
上传用户:ming529
单片机指令系统 3.1 MCS-51指令简介 3.2 指令系统 3.1 MCS-51指令简介 二、MCS-51系列单片机指令系统分类 按寻址方式分为以下七种:按功能分为以下四种: 1、立即立即寻址 1、数据传送指令位操 2、直接寻址 2、算术运算指令 3、寄存器寻址 3、逻辑运算指令 4、寄存器间接寻址指令 4、控制转移类指令 5、相对寻址 5、位操作指令 6、变址寻址 7、位寻址 三、寻址方式 3、寄存器间接寻址 MOV A, @R1 操作数是通过寄存器间接得到的。 4、立即寻址 MOV A, #40H 操作数在指令中直接给出。 5、基址寄存器加变址寄存器寻址 以DPTR或PC为基址寄存器,以A为变址寄存器, 以两者相加形成的16位地址为操作数的地址。 MOVC A, @A+DPTR MOVC A, @A+PC 四、指令中常用符号说明 Rn——当前寄存器区的8个工作寄存器R0~R7(n=0~7); Ri——当前寄存器区可作地址寄存器的2个工作寄存器R0和R1(i=0,1); direct——8位内部数据存储器单元的地址及特殊功能寄存器的地址; #data——表示8位常数(立即数); #datal6——表示16位常数; add 16——表示16位地址; addrll——表示11位地址; rel——8位带符号的地址偏移量; bit——表示位地址; @——间接寻址寄存器或基址寄存器的前缀; ( )——表示括号中单元的内容 (( ))——表示间接寻址的内容; 五、MCS-51指令简介 1. 以累加器A为目的操作数的指令 2. 以Rn为目的操作数的指令 3. 以直接地址为目的操作数的指令 4. 以寄存器间接地址为目的操作数指令 应用举例1 8段数码管显示 应用举例2 3.2 指令系统 2、堆栈操作指令 3. 累加器A与外部数据传输指令 4. 查表指令 MOVC A, @A+PC 例子: 5. 字节交换指令 6. 半字节交换指令 二、算术操作类指令 PSW寄存器 2. 带进位加法指令 3. 加1指令 4. 十进制调整指令 5. 带借位减法指令(Subtraction) 6. 减1指令(Decrease) 7. 乘法指令(Multiplication) 8. 除法指令(Division) 三、逻辑运算指令 1. 简单逻辑操作指令 2. 循环指令 带进位左循环指令(Rotate Accumulator Left through Carry flag) 右循环指令(Rotate Accumulator Right) 带进位右循环指令(Rotate A Right with C) 3. 逻辑与指令 4. 逻辑或指令 5. 逻辑异或指令 四、控制转移类指令 1. 跳转指令 相对转移指令 SJMP rel PC←(PC)+2 PC←(PC)+rel 程序中标号与地址之间的关系 2. 条件转移指令 3. 比较不相等转移指令 4. 减 1 不为 0 转移指令 5. 调用子程序指令 7. 中断返回指令 五、位操作指令 1. 数据位传送指令 2. 位变量逻辑指令 3. 条件转移类指令
上传时间: 2013-10-27
上传用户:xuanjie
The C500 microcontroller family usually provides only one on-chip synchronous serialchannel (SSC). If a second SSC is required, an emulation of the missing interface mayhelp to avoid an external hardware solution with additional electronic components.The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using optimized SW routines with a performance up to 25KBaud in Slave Mode with half duplex transmission and an overhead less than 60% atSAB C513 with 12 MHz. Due to the implementation in C this performance is not the limitof the chip. A pure implementation in assembler will result in a strong reduction of theCPU load and therefore increase the maximum speed of the interface. In addition,microcontrollers like the SAB C505 will speed up the interface by a factor of two becauseof an optimized architecture compared with the SAB C513.Moreover, this solution lays stress on using as few on-chip hardware resources aspossible. A more excessive consumption of those resources will result in a highermaximum speed of the emulated interface.Due to the restricted performance of an 8 bit microcontroller a pin compatible solution isprovided only; the internal register based programming interface is replaced by a set ofsubroutine calls.The attached source files also contain a test shell, which demonstrates how to exchangeinformation between an on-chip HW-SSC and the emulated SW-SSC via 5 external wiresin different operation modes. It is based on the SAB C513 (Siemens 8 bit microcontroller).A table with load measurements is presented to give an indication for the fraction of CPUperformance required by software for emulating the SSC.
标签: synchronous Emulating serial
上传时间: 2014-01-31
上传用户:z1191176801
In this document, the term Ô60xÕ is used to denote a 32-bit microprocessor from the PowerPC architecture family that conforms to the bus interface of the PowerPC 601ª, PowerPC 603ª, or PowerPC 604 microprocessors. Note that this does not include the PowerPC 602ª microprocessor which has a multiplexed address/data bus. 60x processors implement the PowerPC architecture as it is speciÞed for 32-bit addressing, which provides 32-bit effective (logical) addresses, integer data types of 8, 16, and 32 bits,and ßoating-point data types of 32 and 64 bits (single-precision and double-precision).1.1 Overview The MPC106 provides an integrated high-bandwidth, high-performance, TTL-compatible interface between a 60x processor, a secondary (L2) cache or additional (up to four total) 60x processors, the PCI bus,and main memory. This section provides a block diagram showing the major functional units of the 106 and describes brießy how those units interact.Figure 1 shows the major functional units within the 106. Note that this is a conceptual block diagram intended to show the basic features rather than an attempt to show how these features are physically implemented on the device.
上传时间: 2013-10-08
上传用户:18711024007
All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.For input signals, which do not provide the required rise/fall times, external circuitry mustbe used to shape the signal transitions.In the attached diagram, the effect of the sample rate is shown. The numbers 1 to 5 in thediagram represent possible sample points. Waveform a) shows the result if the inputsignal transition time through the undefined TTL-level area is less than the time distancebetween the sample points (sampling at 1, 2, 3, and 4). Waveform b) can be the result ifthe sampling is performed more than once within the undefined area (sampling at 1, 2, 5,3, and 4).Sample points:1. Evaluation of the signal clearly results in a low level2. Either a low or a high level can be sampled here. If low is sampled, no transition willbe detected. If the sample results in a high level, a transition is detected, and anappropriate action (e.g. capture) might take place.3. Evaluation here clearly results in a high level. If the previous sample 2) had alreadydetected a high, there is no change. If the previous sample 2) showed a low, atransition from low to high is detected now.
上传时间: 2013-10-23
上传用户:copu
The P90CL301 is a highly integrated 16/32 bit micro-controller especially suitable for applications requiring lowvoltage and low power consumption. It is fully software compatible with the 68000. Furthermore, it provides bothstandard as well as advanced peripheral functions on-chip.One of these peripheral functions is the I2C bus. This report describes worked-out driver software (written in C) toprogram the P90CL301 I2C interface. It also contains interface software routines offering the user a quick start inwriting a complete I2C system application.
上传时间: 2014-01-06
上传用户:气温达上千万的
All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.
上传时间: 2014-04-02
上传用户:han_zh
This application note demonstrates how to write an Inter Integrated Circuit bus driver (I2C) for the XA-S3 16-bitMicrocontroller from Philips Semiconductors.Not only the driver software is given. This note also contains a set of (example) interface routines and a smalldemo application program. All together it offers the user a quick start in writing a complete I2C system applicationwith the PXAS3x.The driver routines support interrupt driven single master transfers. Furthermore, the routines are suitable foruse in conjunction with real time operating systems.
上传时间: 2013-11-02
上传用户:zw380105939
The XA-S3 is a member of Philips Semiconductors’ XA (eXtended Architecture) family of high performance 16-bit single-chip Microcontrollers. The XA-S3 combines many powerful peripherals on one chip. Therefore, it is suited for general multipurpose high performance embedded control functions.One of the on-chip peripherals is the I2C bus interface. This report describes worked-out driver software (written in C) to program / use the I2C interface of the XA-S3. The driver software, together with a demo program and interface software routines offer the user a quick start in writing a complete I2C - XAS3 system application.
上传时间: 2013-11-10
上传用户:liaofamous