at91rm9200启动过程教程 系统上电,检测BMS,选择系统的启动方式,如果BMS为高电平,则系统从片内ROM启动。AT91RM9200的ROM上电后被映射到了0x0和0x100000处,在这两个地址处都可以访问到ROM。由于9200的ROM中固化了一个BOOTLOAER程序。所以PC从0X0处开始执行这个BOOTLOAER(准确的说应该是一级BOOTLOADER)。这个BOOTLOER依次完成以下步骤: 1、PLL SETUP,设置PLLB产生48M时钟频率提供给USB DEVICE。同时DEBUG USART也被初始化为48M的时钟频率; 2、相应模式下的堆栈设置; 3、检测主时钟源(Main oscillator); 4、中断控制器(AIC)的设置; 5、C 变量的初始化; 6、跳到主函数。 完成以上步骤后,我们可以认为BOOT过程结束,接下来的就是LOADER的过程,或者也可以认为是装载二级BOOTLOER。AT91RM9200按照DATAFLASH、EEPROM、连接在外部总线上的8位并行FLASH的顺序依次来找合法的BOOT程序。所谓合法的指的是在这些存储设备的开始地址处连续的存放的32个字节,也就是8条指令必须是跳转指令或者装载PC的指令,其实这样规定就是把这8条指令当作是异常向量表来处理。必须注意的是第6条指令要包含将要装载的映像的大小。关于如何计算和写这条指令可以参考用户手册。一旦合法的映像找到之后,则BOOT程序会把找到的映像搬到SRAM中去,所以映像的大小是非常有限的,不能超过16K-3K的大小。当BOOT程序完成了把合法的映像搬到SRAM的任务以后,接下来就进行存储器的REMAP,经过REMAP之后,SRAM从映设前的0X200000地址处被映设到了0X0地址并且程序从0X0处开始执行。而ROM这时只能在0X100000这个地址处看到了。至此9200就算完成了一种形式的启动过程。如果BOOT程序在以上所列的几种存储设备中找到合法的映像,则自动初始化DEBUG USART口和USB DEVICE口以准备从外部载入映像。对DEBUG口的初始化包括设置参数115200 8 N 1以及运行XMODEM协议。对USB DEVICE进行初始化以及运行DFU协议。现在用户可以从外部(假定为PC平台)载入你的映像了。在PC平台下,以WIN2000为例,你可以用超级终端来完成这个功能,但是还是要注意你的映像的大小不能超过13K。一旦正确从外部装载了映像,接下来的过程就是和前面一样重映设然后执行映像了。我们上面讲了BMS为高电平,AT91RM9200选择从片内的ROM启动的一个过程。如果BMS为低电平,则AT91RM9200会从片外的FLASH启动,这时片外的FLASH的起始地址就是0X0了,接下来的过程和片内启动的过程是一样的,只不过这时就需要自己写启动代码了,至于怎么写,大致的内容和ROM的BOOT差不多,不同的硬件设计可能有不一样的地方,但基本的都是一样的。由于片外FLASH可以设计的大,所以这里编写的BOOTLOADER可以一步到位,也就是说不用像片内启动可能需要BOOT好几级了,目前AT91RM9200上使用较多的bootloer是u-boot,这是一个开放源代码的软件,用户可以自由下载并根据自己的应用配置。总的说来,笔者以为AT91RM9200的启动过程比较简单,ATMEL的服务也不错,不但提供了片内启动的功能,还提供了UBOOT可供下载。笔者写了一个BOOTLODER从片外的FLASHA启动,效果还可以。 uboot结构与使用uboot是一个庞大的公开源码的软件。他支持一些系列的arm体系,包含常见的外设的驱动,是一个功能强大的板极支持包。其代码可以 http://sourceforge.net/projects/u-boot下载 在9200上,为了启动uboot,还有两个boot软件包,分别是loader和boot。分别完成从sram和flash中的一级boot。其源码可以从atmel的官方网站下载。 我们知道,当9200系统上电后,如果bms为高电平,则系统从片内rom启动,这时rom中固化的boot程序初始化了debug口并向其发送'c',这时我们打开超级终端会看到ccccc...。这说明系统已经启动,同时xmodem协议已经启动,用户可以通过超级终端下载用户的bootloader。作为第一步,我们下载loader.bin.loader.bin将被下载到片内的sram中。这个loder完成的功能主要是初始化时钟,sdram和xmodem协议,为下载和启动uboot做准备。当下载了loader.bin后,超级终端会继续打印:ccccc....。这时我们就可以下在uboot了。uboot将被下载到sdram中的一个地址后并把pc指针调到此处开始执行uboot。接着我们就可以在终端上看到uboot的shell启动了,提示符uboot>,用户可以uboot>help 看到命令列表和大概的功能。uboot的命令包含了对内存、flash、网络、系统启动等一些命令。 如果系统上电时bms为低电平,则系统从片外的flash启动。为了从片外的flash启动uboot,我们必须把boot.bin放到0x0地址出,使得从flash启动后首先执行boot.bin,而要少些boot.bin,就要先完成上面我们讲的那些步骤,首先开始从片内rom启动uboot。然后再利用uboot的功能完成把boot.bin和uboot.gz烧写到flash中的目的,假如我们已经启动了uboot,可以这样操作: uboot>protect off all uboot>erase all uboot>loadb 20000000 uboot>cp.b 20000000 10000000 5fff uboot>loadb 21000000 uboot>cp.b 210000000 10010000 ffff 然后系统复位,就可以看到系统先启动boot,然后解压缩uboot.gz,然后启动uboot。注意,这里uboot必须压缩成.gz文件,否则会出错。 怎么编译这三个源码包呢,首先要建立一个arm的交叉编译环境,关于如何建立,此处不予说明。建立好了以后,分别解压源码包,然后修改Makefile中的编译器项目,正确填写你的编译器的所在路径。 对loader和boot,直接make。对uboot,第一步:make_at91rm9200dk,第二步:make。这样就会在当前目录下分别生成*.bin文件,对于uboot.bin,我们还要压缩成.gz文件。 也许有的人对loader和boot搞不清楚为什么要两个,有什么区别吗?首先有区别,boot主要完成从flash中启动uboot的功能,他要对uboot的压缩文件进行解压,除此之外,他和loader并无大的区别,你可以把boot理解为在loader的基础上加入了解压缩.gz的功能而已。所以这两个并无多大的本质不同,只是他们的使命不同而已。 特别说名的是这三个软件包都是开放源码的,所以用户可以根据自己的系统的情况修改和配置以及裁减,打造属于自己系统的bootloder。
上传时间: 2013-10-27
上传用户:wsf950131
The LPC1700 Ethernet block contains a full featured 10 Mbps or 100 Mbps Ethernet MAC (Media Access Controller) designed to provide optimized performance through the use of DMA hardware acceleration. Features include a generous suite of control registers, half or full duplex operation, flow control, control frames, hardware acceleration for transmit retry, receive packet filtering and wake-up on LAN activity. Automatic frame transmission and reception with Scatter-Gather DMA off-loads many operations from the CPU.
上传时间: 2013-11-09
上传用户:geshaowei
Virtex-5, Spartan-DSP FPGAs Application Note This application note demonstrates how efficient implementations of Digital Up Converters(DUC) and Digital Down Converters (DDC) can be done by leveraging the Xilinx DSP IPportfolio for increased productivity and reduced time to development. Step-by-step instruction is given on how to perform system-level trade off analysis and develop the most efficient FPGA implementation, thus allowing engineers a flexible, low-cost and low-power alternative to ASSP technologies.
标签: Spartan-DSP Virtex FPGAs Ap
上传时间: 2013-10-23
上传用户:raron1989
The PCA9516 is a BiCMOS integrated circuit intended forapplication in I2C and SMBus systems.While retaining all the operating modes and features of the I2Csystem, it permits extension of the I2C-bus by buffering both the data(SDA) and the clock (SCL) lines, thus enabling five buses of 400 pF.The I2C-bus capacitance limit of 400 pF restricts the number ofdevices and bus length. Using the PCA9516 enables the systemdesigner to divide the bus into five segments off of a hub where anysegment to segment transition sees only one repeater delay.
上传时间: 2013-11-21
上传用户:q123321
The outputs of the PCA9518 are immediately available as soon as there is a voltage present on thesupply >~1V and behave as described above. The power-on reset of the PCA9518A keeps the outputsturned off during power-up and maintains the high impedance of the outputs throughout the power-upcycle. There is an additional built-in delay after power-up that allows the analog circuits to stabilize beforethe part is activated.
标签: Replacement 9518 NXP PCA
上传时间: 2013-10-26
上传用户:13817753084
PLC 以 其 可靠性高、抗干扰能力强、配套齐全、功能完善、适应性强等特点,广泛应用于各种控制领域。PLC作为通用工业控制计算机,是面向工矿企业的工控设备,使用梯形图符号进行编程,与继电器电路相当接近,被广大工程技术人员接受。但是在实际应用中,如何编程能够提高PLC程序运行速度是一个值得我们思考研究的问题。1 PLC工作原理PLC 与 计 算机的工作原理基本相同,即在系统程序的管理下,通过运行应用程序完成用户任务。但两者的工作方式有所不同。计算机一般采用等待命令的工作方式,而PLC在确定了工作任务并装人了专用程序后成为一种专用机,它采用循环扫描工作方式,系统工作任务管理及应用程序执行都是用循环扫描方式完成的。PLC 有 两 种基本的工作状态,即运行(RUN)与停止(STOP)状态。在这两种状态下,PLC的扫描过程及所要完成的任务是不尽相同的,如图1所示。 PLC在RUN工作状态时,执行一次扫描操作所的时间称为扫描周期,其典型值通常为1一100nis,不同PLC厂家的产品则略有不同。扫描周期由内部处理时间、输A/ 输出处理执行时间、指令执行时间等三部分组成。通常在一个扫描过程中,执行指令的时间占了绝大部分,而执行指令的时间与用户程序的长短有关。用户 程 序 是根据控制要求由用户编制,由许多条PLC指令所组成。不同的指令所对应的程序步不同,以三菱FX2N系列的PLC为例,PLC对每一个程序步操作处理时间为:基本指令占0.741s/步,功能指令占几百微米/步。完成一个控制任务可以有多种编制程序的方法,因此,选择合理、巧妙的编程方法既可以大大提高程序运行速度,又可以保证可靠性。 提高PLC程序运行速度的几种编程方法2.1 用数据传送给位元件组合的方法来控制输出在 PL C应 用编程中,最后都会有一段输出控制程序,一般都是用逻辑取及输出指令来编写,如图2所示。在图2所示的程序中,逻辑取的程序步为1,输出的程序步为2,执行上述程序共需3个程序步。通常情况下,PLC要控制的输出都不会是少量的,比如,有8个输出,在条件满足时要同时输出。此时,执行图2所示的程序共需17个程序步。若我们通过位元件的组合并采用数据传送的方法来完成图2所示的程序,就会大大减少程序步骤。在三 菱 PLC中,只处理ON/OFF状态的元件(如X,Y,M和S),称为位元件。但将位元件组合起来也可以处理数据。位元件组合由Kn加首元件号来表示。位元件每4bit为一组组合成单元。如KYO中的n是组数,当n=1时,K,Yo 对应的是Y3一Yo。当n二2时,KZYo对应的是Y7一Yo。通过位元件组合,就可以用处理数据的方式来处理位元件,图2程序所示的功能可用图3所示的传送数据的方式来完成。
上传时间: 2013-11-11
上传用户:几何公差
This application note describes how the existing dual-port block memories in the Spartan™-IIand Virtex™ families can be used as Quad-Port memories. This essentially involves a dataaccess time (halved) versus functionality (doubled) trade-off. The overall bandwidth of the blockmemory in terms of bits per second will remain the same.
上传时间: 2013-11-08
上传用户:lou45566
This application note shows how to achieve low-cost, efficient serial configuration for Spartan FPGA designs. The approachrecommended here takes advantage of unused resources in a design, thereby reducing the cost, part count, memory size,and board space associated with the serial configuration circuitry. As a result, neither processor nor PROM needs to be fullydedicated to performing Spartan configuration.In particular, information is provided on how the idle processing time of an on-board controller can be used to loadconfiguration data from an off-board source. As a result, it is possible to upgrade a Spartan design in the field by sending thebitstream over a network.
上传时间: 2014-08-16
上传用户:adada
The NCV7356 is a physical layer device for a single wire data linkcapable of operating with various Carrier Sense Multiple Accesswith Collision Resolution (CSMA/CR) protocols such as the BoschController Area Network (CAN) version 2.0. This serial data linknetwork is intended for use in applications where high data rate is notrequired and a lower data rate can achieve cost reductions in both thephysical media components and in the microprocessor and/ordedicated logic devices which use the network.The network shall be able to operate in either the normal data ratemode or a high-speed data download mode for assembly line andservice data transfer operations. The high-speed mode is onlyintended to be operational when the bus is attached to an off-boardservice node. This node shall provide temporary bus electrical loadswhich facilitate higher speed operation. Such temporary loads shouldbe removed when not performing download operations.The bit rate for normal communications is typically 33 kbit/s, forhigh-speed transmissions like described above a typical bit rate of83 kbit/s is recommended. The NCV7356 features undervoltagelockout, timeout for faulty blocked input signals, output blankingtime in case of bus ringing and a very low sleep mode current.
上传时间: 2013-10-24
上传用户:s蓝莓汁
The LTC®3207/LTC3207-1 is a 600mA LED/Camera driverwhich illuminates 12 Universal LEDs (ULEDs) and onecamera fl ash LED. The ULEDs are considered universalbecause they may be individually turned on or off, setin general purpose output (GPO) mode, set to blink at aselected on-time and period, or gradate on and off at aselected gradation rate. This device also has an externalenable (ENU) pin that may be used to blink, gradate, orturn on/off the LEDs without using the I2C bus. This may beuseful if the microprocessor is in sleep or standby mode. Ifused properly, these features may save valuable memoryspace, programming time, and reduce the I2C traffi c.
上传时间: 2014-01-04
上传用户:LANCE