AVR1000XMEGA的C语言代码编写入门.docx
《AVR1000XMEGA的C语言代码编写入门.docx》由会员分享,可在线阅读,更多相关《AVR1000XMEGA的C语言代码编写入门.docx(21页珍藏版)》请在优知文库上搜索。
1、8-bit8位Microcontro1.1ers微处理器App1.icationNote应用注释AVR1000:GettingStartedWritingC-codeforXMEGAAVR1000:XMEGA的C语言代码编写入门Features特点:NaaingconventionsRegisterDeae8存放名-BitDMM位名,C-COdenaaesC-ft码名Bitandgroupaariu位与融舞科GroupCoafi1.UrBt100auks,Method*foraccMincregister*访问存放,的方法,Methodsforwritingreusab1.eKdu1.efun
2、ctions可层次使用横映功俺的写入方法1Introduction引言ShortdevcIojmcnttinesandhighqua1.ityrcquircmcn1.sone1.ectronicproductshasmadehigh-1.eve1.rogramingIa11Raesarequirement.Thenainreasonisthat1.1.ih1.eve1.1.anguagesnakeiteasiertomaintainandreusecodeduetobetterportabi1.ityandreadabi1.ity.由于电子产品的开发时间短,质/要求高,因此需要高层次的编程语言
3、。最主要的原因是,高级语言具有更好的可移植性和可读性,使其更易于维护和理更使用代码.Thechoiceofprogra11ming1.anguagea1.onedoesnotensurehighreadabiIityandreusabi1.ity;goodcodingsty1.edoes.ThereforetheXMEGwperiphera1.s,headerfi1.esanddriversaredesignedwiththisinmind.编程语言的选择本身并非是能神保具有较高的可读性和可用会使用性的唯一条件,还必须有良好的涮码风格。因此XMEGAn的外围设备头文件和驱动程序的设计都是基干这
4、方面考虑的.Themostwide1.yusedhih1.eve1.1.anguageforAVR*microcontro1.1.ersisCandthisapp1.icationnotethereforefocusesonCprogrurnning.TosupportmostoftheAVRCCOnPi1.OrSthatareavai1.ab1.ethecodeexamp1.esareasfaraspossib1.ewritteninANSIC.Afewexa11p1.esarespecificto1KIinbeddedWorkbench,buttheideasandmethodscanbe
5、usedforotherCOmPi1.erSwithminorchanges.IARspecificexanp1.esarec1.ear1.yarkt*d.VRK微控制使用的最广泛的高级谙音就是C语音,因此本应用注释的型点是C谙吉娟程.为了支持大多数可用的AYRC语古摘译器,我们尽可能把代码例如编写在ANSIC语吉的标准中.有些例子是IREmbeddedWorkbench专用的,但其思路和方法可用于与其他变化不大的编译器,IAR专用的例如都有清晰的标示。2 XMEGAModu1.esXMEGA模块AnAVRXMHGAisconposedofsevera1.buiIdingb1.ocks:AnA
6、VRCPUcore,SRAM.F1.ash,EEPROMRndanuherofperiphera1.rr)du1.es.Thesebui1.dingb1.ocksareca1.1.ed“nodu1.etypes*.AnXMEGAcanhaveoneorrureinstancesofagivennodu1.etype.A1.1.instcincesofamodu1.etypehavethesamefeaturesandfunctions.一个VRXMIG由数个结构块组成:一个AYRCHJ芯片,一个SRAM,一个闪存,一个EKPROM以及若干外设模块:这些结构块被称为“模块类里”,XMEGA可以有
7、一个或多个给定模块类型的实例。一个模块类型的所有实例都具有相同的特性和功能,Sonenodu1.etypescanbeasubsetofOthermodu1.etypes.Theseinheritasubsetofthefeatures(andregisters)ofthesupertype,a1.1.inheritedfeaturesarefu1.1.ycompatib1.e.Thisapp1.iestoe.g.timersand10ports.Thesubsetofanodu1.e?typecanfora1.inermeanthatithasfewerconpareandcapturech
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- AVR1000XMEGA 语言 代码 编写 入门
