在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → CCS C Compiler

CCS C Compiler

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:0.11M
  • 下载次数:3
  • 浏览次数:210
  • 发布时间:2020-09-04
  • 实例类别:一般编程问题
  • 发 布 人:robot666
  • 文件格式:.pdf
  • 所需积分:2
 

实例介绍

【实例简介】
学习PIC CCS的好东西,是初学PIC CCS的好帮手
ew built-in function to restart the processor. RESET CPUO Will jump to location 0 on 12 and 14 bit parts and also reset the registers to poweT-up state on the pic18 PCW IDE changes View data sheet and view valid fuses have moved to the view menu Vicw Valid Interrupts has been added to show a chips valid interrupts The device h file format has been updated. Information about device specific functions available is now in the. h file. The following defines supported for compatibility with the old c71 compiler are no longer in the h file. Use the newer names RTCC ZERO USE Int rtcc EXT iNT uSe INT EXt adc done use int ad #DEVICE must now be the first non-comment line in the program. Some pre-processor directives may appear before this like #include and #define. Previous versions of the compiler did not require a #device(it defaulted to a 7l in PCM) o The function EXT INT EDGe now accepts two parameter. The first parameter is the external interrupt number(0, I or 2)for the Pici8. If used it has no effect on 14 bit parts. If there is only one parameter the function works as it used to on external interrupt o o The functions SETUP COUNTERSO, SET RTCCO and GEt RTCC are still accepted by the compiler however newer functions will provide better compatibility across families. The newer functions are: SETUP TIMEROO, SETUP WDTO, SET TIMEROO and GET TImeroo. Note that the Pic1& SETUP WDTO only allows the Wdt to be turned on or off, the time is sct with #FUSES. The other PiCs are the opposite The TIMERo is 16 bit on the picl& by default but can be setup to 8 bit e For the pic18 the REad/ WRitE PROGRAM EEPROM accept a byte address and the read returns a byte result. The WRitE will only work if a programming voltage is applied to the chip. The previously undocumented function ISAMOUNG is documented in this version ISAMOUNG returns true if a character is one of the characters in a constant string. For example if( ISAMOUNG(X, 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ)) o Quoted strings now accept inserted hex numbers via x. For example: printf("Hi thereXODXOA") By default the compiler treats SHORT as one bit, INT as 8 bits and LONG as 16 bits. The traditional c convention is to have int defined as the most efficient size for the target processor This is why it is bits on the pic In order to help with code compatibility a new directive has been added that will allow these types to be changed. #TYpe can redefine these keywords For example #TYPE SHORT=8.NT-16. LONG-32 Note that the commas are optional. Since #tYpe may render some sizes inaccessible (like a one bit int in the above) four new keywords have been added to represent the four ints: INTl, INT8, INT16 and INT32 Be warned CCs example programs and include files may not work right if you use #TYpe in your program e The aBs, LABS and Fabs functions were implemented as simple c functions in stdlib. h. ABSO is now built into the compiler and accepts any type as a parameter. It returns the same type as the argument. For compatibility LABS and fabs are #defined to abs in stdlib. h o The debug file ( cod) has been expanded from the microchip definition to to include information to permit advanced debugging. This includes all C data types and better tracking information. CCs now provides a dlL that may be used by debuggers to use this information. For example it is possible to have a watch expression like: TABLE[I. LAST-TABLElI]FIRST The new dll knows how to evaluate the expression and provide a properly formatted string back to the debugger. Arrays and structures are also properly formatted. The stack frame may be viewed along with the parameters passed at each level and function return values may be traced. CCS is working with emulator manufactures to make use of thesc new capabilities o The PCW help filename has been changed from PCW. hLP to CCSC. HLP. The same help file is used for PCB, PCM, and PCh e The PCw context sensitive help has been enhanced. Placing the cursor on C keyword, preprocessor directive or built in function and pressing F1 wli any bring up help on that item. In addition pressing Fl when a red error message is being shown will bring up additional help with that error o The pCw ide now allows the toolbar to be customized o A number of internal compiler limits have been increased For example the limitation of a macro expansion being less than 256 characters is now 32768 Changes not documented in the may-2001 manual: o If@filename appears on the CCsc command line command line options will be read from the specified file. Parameters may appear on multiple lines in the file If the file ccsc.ini exists in the same directory as CCsC.eXe then command line parameters are read from that file before they are processed on the command line e printf now accepts both 16 and 32 bit variables for %LU and %LD e #define macros now accept the ANSI operators and ##. In summary the #idx will be replaced with"param" and idx##idy is replaced with paramxparamy and is expanded if a new macro namc is formcd e elif is now supported. For example #if device ==71 #define adc pin Pin Ao #elif device 74 #define adc pin Pin a2 #elif device ==874 #define adc pinPin eO felse #define adc pin Pin al #endif o #if directives now support: defined (id) This expression evaluates to l if id is a preprocessor id and 0 otherwise. For example #ifdef PCB #include <16c54.h> #elif defined( PCM #include <16c74.h> #elif defined pCh #include <18c658.h> fendi o printf now supports %os to insert a constant or variable string o Three functions have been added to make manipulation of bytes within variables easier 8 MAKES(var, offset extracts the byte at offset from var Same as: i8(((var >>(offset 8 ))&oxff) except it is done with a single byte mov 116=MAKE16(varhigh, varlow) Makes a l6 bit number out of two 8 bit numbers If either parameter is 16or 32 bits only the lsb is used Same as: 1l6=(int16(varhigh&oxff)*0x100+ (varlow&Oxff) except it is done with two byte moves 132-MAKE32(var l, var 2, var3, var4) Makes a 32 bit number out of any combination of 8 and 16 bit numbers note that the number of parameters may be 1 to 4. The msb is first If the total bits provided is less than 32 then zeros are added at the msb e # asm now accepts a parameter to prevent the compiler from doing automatic bank switching and optimization in the ASM code. For example #byte x=0xa0 # asm cIrfx #endasm Will generate a bank switch to bank I and a clear of location 20 in that bank #asm ASIS #c endasm Will just generate the clear of location 20 and ignore the bank e The REAd ADCO function always defaults to a bit result. This may be different from previous versions where the defualt was different depending on the chip. Use #DEVICE ADC=XX to specify the desired resolution e Constant strings are now concatenated when they appear separated by white space. For example: printf("hi""); is the same as printf("hithere") Changes not documented in the july-2001 manual: e Arrays may be defined with d in many cases. For example const char id[ =t"Hi There");// Same as [9] ∥/ Same as*x intx[]={1,2,3} / Same as [3 The #USE I2C option NOFORCE SW is still accepted however the new FORCE HW is what will appear in future documentation #INT ??? directives now allow a noclear option to prevent the compiler from clearing the interrupt. For example #INT RTCC NOCLEAR 【实例截图】
【核心代码】

标签:

实例下载地址

CCS C Compiler

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警