资源描述:
《ATMEL公司24系列EEPROM编程举例.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、此文档收集于网络,如有侵权,请联系网站删除ATMEL公司24系列EEPROM编程举例作者:尘封往事文章来源:本站原创点击数:2043更新时间:2006-1-1213:07:34NAME Control_AT24Cxx;ThiscollectionofroutinesallowsanAT89C2051microcontrollertoread
;andwritetheAT24CxxfamilyofserialCMOSEEPROMS.Thisversionofthe
;codeiscompatibleonlywiththeAT89C2051duetoth
2、elocationofthe
;databufferandstackinRAM.Thecodemaybemodifiedtoworkwiththe
;AT89C1051byrelocatingorresizingthebufferandstacktofitintothe
;smalleramountofRAMavailableintheAT89C1051.Notethattheminimum
;sizeofthebufferisdeterminedbythepagesizeoftheAT24Cxx.
;
;AllfiveAT24Cxxdeviceop
3、erationsaresupported.ByteWrite,Current
;AddressReadandRandomReadareimplementedbythefunctionsWRITE_BYTE,
;READ_CURRENTandREAD_RANDOM,respectively.PageWriteandSequentialRead
;arespecialcasesoffunctionsWRITE_BLOCKandREAD_BLOCK,respectively.
;WRITE_BLOCKandREAD_BLOCKprocessfromoneb
4、ytetothenumberofbytes
;inapageandtransferdatabetweentheAT24CxxandtheRAMbuffer.
;
;ThecodesupportsmultipleAT24Cxxdevicesperbus,eachwithaunique
;addressdeterminedbythewiringoftheaddresspins(A0,A1,A2).The
;three-bitprogrammableaddressispassedtotheWRITE_BYTE,READ_CURRENT,
;READ_RAN
5、DOM,WRITE_BLOCKandREAD_BLOCKfunctions,whereitiscombined
;withtheAT24Cxxfixedaddress(FADDR)andusedtoaddressadeviceonthe
;bus.RefertotheAT24Cxxfamilydatasheetsforadditionalinformationon
;deviceaddressing.
;
;FunctionsBYTE_FILL,VERIFY_BYTE_FILL,PAGE_FILLandVERIFY_PAGE_FILLare
;art
6、ifactsfromthedebugprocessandservetoillustratetheuseof此文档仅供学习与交流此文档收集于网络,如有侵权,请联系网站删除the
;devicereadandwritefunctionswithanAT24C64.Tomodifythecodefora
;differentmemberoftheAT24Cxxfamily,simplyredefinethevaluesofSIZE
;(thenumberofbytesperdevice)andPSIZE(thenumberofbytesperpage).
7、;Tochangethefillvalue,redefineFILL.Tochangetheprogrammableportion
;ofthedeviceaddress,redefinePADDRtoavaluefromzerotoseven.
;
;ThecodemeetsallAT24Cxxfamilytimingrequirementswhenexecutedbyan
;AT89Cx051microcontrollerwitha12MHzclock.Codemodificationsmaybe
;requiredifafasterclocki
8、ssubstituted.
FADDR EQU 0a0h ;fixedaddressforAT24Cxx