; This collection of routines allows an AT89C2051 microcontroller to read ; and write the AT24Cxx family of serial CMOS EEPROMS. This version of the ; code is compatible only with the AT89C2051 due to the location of the ; data buffer and stack in RAM. The code may be modified to work with the ; AT89C1051 by relocating or resizing the buffer and stack to fit into the ; smaller amount of RAM available in the AT89C1051. Note that the minimum ; size of the buffer is determined by the page size of the AT24Cxx.
该程序集允许AT89C2051读写AT24Cxx系列串行CMOS EEPROM. 此版本代码仅仅适用于AT89C2051的内存的数据缓冲和堆栈。 此代码经改进可以用于AT89C1051,改变缓冲和堆栈值,以适应AT89C1051内部较小的可用内存 注,最小缓冲值由AT24Cxx页尺寸决定。
; All five AT24Cxx device operations are supported. Byte Write, Current ; Address Read and Random Read are implemented by the functions WRITE_BYTE, ; READ_CURRENT and READ_RANDOM, respectively. Page Write and Sequential Read ; are special cases of functions WRITE_BLOCK and READ_BLOCK, respectively. ; WRITE_BLOCK and READ_BLOCK process from one byte to the number of bytes ; in a page and transfer data between the AT24Cxx and the RAM buffer.
AT24Cxx全部五种设备操作均被支持。字节写(Byte Write)、当前地址读(Current Address Read)和随机读(Random Read) 分别由WRITE_BYTE、READ_CURRENT和READ_RANDOM函数实现。 页写(Page Write)和连续读(Sequential Read)分别是函数WRITE_BLOCK和READ_BLOCK的特例。 WRITE_BLOCK和READ_BLOCK处理一个字节到一页的字节数,并在AT24Cxx和内存缓冲间传送数据。
; The code supports multiple AT24Cxx devices per bus, each with a unique ; address determined by the wiring of the address pins (A0, A1, A2). The ; three-bit programmable address is passed to the WRITE_BYTE, READ_CURRENT, ; READ_RANDOM, WRITE_BLOCK and READ_BLOCK functions, where it is combined ; with the AT24Cxx fixed address (FADDR) and used to address a device on the ; bus. Refer to the AT24Cxx family data sheets for additional information on ; device addressing.
代码支持一条总线上的多个AT24Cxx,每个设备的唯一地址由地址脚(A0,A1,A2)的连线决 定。三位编程地址被传送到WRITE_BYTE,READ_CURRENT,READ_RANDOM,WRITE_BLOCK和 READ_BLOCK函数中,与AT24Cxx固定地址(FADDR)组合,确定总线上的设备地址。 设备选址的附加信息查阅AT24Cxx系列内存的数据表。
; Functions BYTE_FILL, VERIFY_BYTE_FILL, PAGE_FILL and VERIFY_PAGE_FILL are ; artifacts from the debug process and serve to illustrate the use of the ; device read and write functions with an AT24C64. To modify the code for a ; different member of the AT24Cxx family, simply redefine the values of SIZE ; (the number of bytes per device) and PSIZE (the number of bytes per page). ; To change the fill value, redefine FILL. To change the programmable portion ; of the device address, redefine PADDR to a value from zero to seven.
函数BYTE_FILL,VERIFY_BYTE_FILL,PAGE_FILL和VERIFY_PAGE_FILL从调试处理和服务到 设备读写功能的使用是以AT24C64为例的。 可修改代码用于AT24Cxx系列的其他型号,简单地重新定义下SIZE的值(内存的总 字节数)和PSIZE的值(每页的字节数)。改变要填充的值,重新定义FILL。改变设备地址 的编程部分,重新设置为一个0到7之间的数值。
; The code meets all AT24Cxx family timing requirements when executed by an ; AT89Cx051 microcontroller with a 12 MHz clock. Code modifications may be ; required if a faster clock is substituted.
在AT89Cx051处理器采用12MHz的时钟时,代码能满足所有AT24Cxx系列内存的时序要求。 处理器运行在更高时钟时,代码需要修改。
以上就是本人的译文,好些地方没有搞明白,有英文高手的话,指点1下.谢谢. 本人一直认为,读懂注释,对理解程序有很大的帮助,我努力想搞明白这些英文的意思.
|