SW006010 Microchip Technology, SW006010 Datasheet

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
®
MPLAB
C17
C COMPILER
USER’S GUIDE
 2002 Microchip Technology Inc.
DS51290A

Related parts for SW006010

SW006010 Summary of contents

Page 1

... Microchip Technology Inc. MPLAB C COMPILER USER’S GUIDE ® C17 DS51290A ...

Page 2

... Serialized Quick Turn Programming (SQTP service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2002, Microchip Technology Incorporated. Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received QS-9000 quality system ...

Page 3

... Chapter 4. Using MPLAB C17 on the Command Line 4.1 Introduction ........................................................................................ 37 4.2 Highlights ........................................................................................... 37 4.3 Command Line Overview .................................................................. 37 4.4 Using MPLAB C17 on the Command Line ........................................ 39 4.5 Code Development ............................................................................ 43 4.6 Library Information ............................................................................ 43  2002 Microchip Technology Inc. ® MPLAB Table of Contents C17 C COMPILER USER’S GUIDE DS51290A-page iii ...

Page 4

... Writing the Interrupt Vector ................................................................67 8.5 Interrupt Service Routine Context Saving ..........................................68 8.6 Latency ..............................................................................................68 8.7 Nesting Interrupts ..............................................................................68 8.8 Enabling/Disabling Interrupts .............................................................69 Chapter 9. Mixing Assembly Language and C Modules 9.1 Introduction ........................................................................................71 9.2 Highlights ...........................................................................................71 9.3 Internal Assembler .............................................................................71 9.4 Calling Conventions ...........................................................................72 DS51290A-page iv  2002 Microchip Technology Inc. ...

Page 5

... Structures and Unions ................................................................... 115 12.10 Bit-Fields ..................................................................................... 115 12.11 Enumerations .............................................................................. 115 12.12 Switch Statement ........................................................................ 116 12.13 Preprocessing Directives ............................................................. 116 Chapter 13. MPLAB C17 Diagnostics 13.1 Introduction .................................................................................... 117 13.2 Highlights ....................................................................................... 117 13.3 Errors ............................................................................................. 117 13.4 Warnings ....................................................................................... 121  2002 Microchip Technology Inc. Table of Contents DS51290A-page v ...

Page 6

... A.4 General C Information .....................................................................125 Appendix B. Example Programs B.1 Introduction ......................................................................................127 B.2 Highlights .........................................................................................127 B.3 Overview of Example Files ..............................................................127 B.4 Example Details ..............................................................................127 Appendix C. ASCII Character Set ........................................................ 129 Glossary ................................................................................................. 131 Index ....................................................................................................... 147 Worldwide Sales and Service ............................................................... 154 DS51290A-page vi  2002 Microchip Technology Inc. ...

Page 7

... MPLAB IDE. • Chapter 4: Using MPLAB C17 on the Command Line – describes how to use the MPLAB C17 compiler from the command line interface. More compiler options are available on the command line.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’ ...

Page 8

... Glossary – A glossary of terms used in this guide. • Index – Cross-reference listing of terms, features and sections of this document. • Worldwide Sales and Service – gives the address, telephone and fax numbers for Microchip Technology Inc. sales and service locations throughout the world. apRNOVM^-page 2 directory. ...

Page 9

... Documents are numbered with a “DS” number. The number is located on the bottom of each page, in front of the page number. The numbering convention for the DS Number is: DSXXXXXA, where: XXXXX = A =  2002 Microchip Technology Inc. Represents Sample code Filenames and paths Variables Optional arguments Choice of mutually exclusive arguments selection ...

Page 10

... Windows. TROUBLESHOOTING See the README guide. apRNOVM^-page 4 ™ and MPLIB ™ ® Manuals files for information on common problems not addressed in this user’s ™ linker, etc.), ™ (DS33014) Acrobat (pdf) format.  2002 Microchip Technology Inc. ...

Page 11

... MPLAB ASM30 assemblers; MPLINK and MPLAB LINK30 linkers; and MPLIB and MPLAB LIB30 librarians. Emulators - The latest information on Microchip in-circuit emulators. This includes the MPLAB ICE 2000. In-Circuit Debuggers - The latest information on Microchip in-circuit debuggers. These include the MPLAB ICD and MPLAB ICD 2.  2002 Microchip Technology Inc. Preface Part 1 Part 2 ...

Page 12

... Microchip’s development systems software products. Plus, this line provides information on how customers can receive the most current upgrade kits. The Information Line Numbers are: 1-800-755-2345 for U.S. and most of Canada. 1-480-792-7302 for the rest of the world. apRNOVM^-page 6  2002 Microchip Technology Inc. ...

Page 13

... Section 1 – MPLAB C17 Basics Chapter 1. Compiler Overview and Installation .......................................9 Chapter 2. Differences Between MPLAB C17 and ANSI C....................15 Chapter 3. Using MPLAB C17 with MPLAB IDE.....................................23 Chapter 4. Using MPLAB C17 on the Command Line...........................37  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE ...

Page 14

... MPLAB C17 C Compiler User’s Guide apRNOVM^-page 8  2002 Microchip Technology Inc. ...

Page 15

... Microchip’s PICmicro MCU peripherals. The C libraries include: A/D converter, Character Classification, External LCD, I Support Macros, I/O Port, Memory/String Manipulation, Number/Text Conversion, Pulse Width Modulation, RESET, Relay, Software I USART, SPI, Timers and USART.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE 2 ™ ...

Page 16

... MPLAB Emulator IN-CIRCUIT DEBUGGERS MPLAB ICD MPLAB ICD 2 GENERATING EXECUTABLE CODE FROM ONE OBJECT MODULE MPLINK Linker MAIN.HEX Programmer MAIN.O LINKERS ™ MPLINK Linker MPLAB LINK30 Linker IDE PROGRAMMERS ® PICSTART Plus ® PROMATE II MCU  2002 Microchip Technology Inc. ...

Page 17

... FIGURE 1-3: MAIN.C MPLAB C17 MORE.C MPLAB C17 FIGURE 1-4: UNIT1.C UNIT2.C UNIT3.C  2002 Microchip Technology Inc. Compiler Overview and Installation GENERATING EXECUTABLE CODE FROM OBJECT MODULES UNITS.LIB MPLINK Linker MAIN.HEX MAIN.O MORE.O CREATING A REUSABLE OBJECT LIBRARY MPLIB Librarian MPLAB C17 UNIT1 ...

Page 18

... MPLAB C17 DEFAULT EXTENSIONS Purpose Default source file extension input to MPLAB C17: <source_name>.c Output extension from MPLAB C17 for error files: <source_name>.err Output extension from MPLAB C17 for object files: <source_name>.o ® operating  2002 Microchip Technology Inc. ...

Page 19

... From the Start menu, select Settings > Control Panel to display the Control Panel directory. 2. Double-click the Add/Remove Programs icon. Scroll down the list and locate the program you want to remove. Click Remove.  2002 Microchip Technology Inc. Compiler Overview and Installation mcc17d.exe mcc17.exe file ...

Page 20

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 14  2002 Microchip Technology Inc. ...

Page 21

... RAM before the pre-execution items that may be necessary, such as setting up a software stack. These specialized items may be written assembly code. In either case, the programmer must decide what is needed.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE function executes ...

Page 22

... Placing the function declaration here is called prototyping. function1 ANSI C AND MPLAB C17 KEYWORDS double long else near enum ram extern register** far return float rom for short goto signed if sizeof int static struct switch typedef union unsigned void volatile while  2002 Microchip Technology Inc. ...

Page 23

... SYNTAX list-directive: #pragma list new-line #pragma nolist new-line  2002 Microchip Technology Inc. ” is used, MPLAB C17 looks for the file in the current directory and and command-line option ‘-i’. MCC_INCLUDE > is used, MPLAB C17 looks for the file in the directories specified ...

Page 24

... MPLAB C17, the data section type, SFR or GPR, idata varlocate varlocate [location]] new-line [location]] new-line 0x120 . 0x120 . 0x8000 by the linker. SHAREBANK by the ACCESSBANK pragma with the same information , this qualifier provides . The linker will enforce that the  2002 Microchip Technology Inc. ...

Page 25

... INT_MIN INT_MAX UINT_MAX LONG_MIN LONG_MAX ULONG_MAX CHAR_MIN CHAR_MAX  2002 Microchip Technology Inc. pragma tells the compiler where a variable will be located at link time, is signed by default. See Chapter 6 for more on data types. STANDARD INTEGER TYPES Value 8 Width of char type, in bits -128 Minimum value of signed char ...

Page 26

... Maximum representable finite number BASIC SIZES Type , auto storage class specifier. register auto . static and 16 bits wide, the argument will be PRODL . types, both of which are double Meaning Size in Bits and extern register static parameter is static auto parameter is static  2002 Microchip Technology Inc. ...

Page 27

... To copy data from ROM to RAM, an explicit copy is required. For simple types, this entails only a simple assignment, but for arrays and other complex data-types it may require more.  2002 Microchip Technology Inc. pair. Otherwise returned on the software stack. INITIALIZING ARRAYS and qualifiers ...

Page 28

... Bit-fields allow the specification of integer-type members of a struction, which are the specified number of bits in size. Bit-fields cannot cross byte boundaries and, therefore, cannot be greater than 8 bits in size. apRNOVM^-page 22 , takes a pointer to a string as its putsUSART1(const char *str) /* ROM pointer */ /* RAM pointer (default RAM pointer */ /* (explicitly declared) */  2002 Microchip Technology Inc. ...

Page 29

... See the MPLAB IDE User’s Guide (DS51025) for more information on MPLAB IDE and MPLAB IDE Projects. Figure 3-1 shows a generic MPLAB Project using the MPLAB C17 compiler tool.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’ ...

Page 30

... Source Files ASSEMBLER/ COMPILER Object Files Library & Linker Script device.lkr Files LINKER Output prog.map Files SIMULATOR/ EMULATORS/ ® II ® PROGRAMMERS Plus ) for main.o  2002 Microchip Technology Inc. ...

Page 31

... This file and other precompiled object files are linked via MPLINK linker ex1.o according to directions in the linker script file ( output file, ex1.hex  2002 Microchip Technology Inc. Using MPLAB C17 with MPLAB IDE is associated with the compiler (MPLAB C17) to produce the object p17c756s.lkr . ...

Page 32

... AN MPLAB PROJECT WITH MPLAB C17 Precompiled Object Files c0s17.o p17c756a.o p17c756s.lkr MPLINK Linker ex1.hex in a directory called, for example, ex1.c Source File COMPILER Object Files Linker Script File LINKER Main Output File . This is a very c:\proj0  2002 Microchip Technology Inc. ...

Page 33

... In Project > New Project select the directory Name for the new project. FIGURE 3-4: After setting the project name, click OK and the Edit Project dialog will be shown.  2002 Microchip Technology Inc. Using MPLAB C17 with MPLAB IDE DEVELOPMENT MODE – PIC17C756A c:\proj0 NEW PROJECT – ...

Page 34

... HEX file name and activate the Node Properties button. Then click on Node Properties. FIGURE 3-5: apRNOVM^-page 28 in the Project Files section of the Edit Project dialog to highlight EDIT PROJECT – ex1.pjt under Include Path. c:\mcc\h  2002 Microchip Technology Inc. ...

Page 35

... For this tutorial, these do not need to be changed. Refer to the MPASM™ User's Guide with MPLINK™ and MPLIB™ (DS33014) for more information on these command line switches. Click OK to set these default values to  2002 Microchip Technology Inc. Using MPLAB C17 with MPLAB IDE NODE PROPERTIES – ex1.hex . ...

Page 36

... In the Add Node dialog, click on the source file, Make sure “List files of type:” specifies ‘Source files (*.c;*.asm)’. Click OK. FIGURE 3-8: apRNOVM^-page 30 EDIT PROJECT – ADD NODE ex1.c , from the ex1.c ADD NODE – ex1.c , the ex1.c directory. c:\proj0  2002 Microchip Technology Inc. ...

Page 37

... However, while learning how to use the compiler generally suggested that the large memory model be used, to ensure proper page and bank selection. FIGURE 3-10:  2002 Microchip Technology Inc. Using MPLAB C17 with MPLAB IDE EDIT PROJECT – ex1.c ADDED NODE PROPERTIES – ex1.o in the ex1 [ ...

Page 38

... Interrupt Service Routines – PIC17C756A Register Definitions , the small memory model startup file is used ex1.c ). There are no interrupts interrupt idata17.o ). But processor-specific register definitions int756al.o ). ADD NODE – OBJECT FILES ) may (.lib  2002 Microchip Technology Inc. ...

Page 39

... The Edit Project window should now look like this: FIGURE 3-13: Press OK on the Edit Project dialog to finish editing the project.  2002 Microchip Technology Inc. Using MPLAB C17 with MPLAB IDE directory. Make sure “List files of type:” specifies c:\mcc\lkr ADD NODE – ...

Page 40

... Select Project > Make Project from the menu to compile the application using MPLAB C17 and MPLINK linker. A Build Results window is created that shows the command lines sent to each tool. It should look like this: FIGURE 3-14: apRNOVM^-page 34 BUILD RESULTS – ex1.hex  2002 Microchip Technology Inc. ...

Page 41

... Compile the project in a DOS window. Cut-and-paste command-line information into a DOS window to run. Check the includes the executable directory ( and represents the include directory (  2002 Microchip Technology Inc. Using MPLAB C17 with MPLAB IDE executable (Figure 3-15). Your executable path may be different INSTALL LANGUAGE TOOL – MPLAB C17 executable (Figure 3-16). Your executable path may be INSTALL LANGUAGE TOOL – ...

Page 42

... Chapter 4 “Using MPLAB C17 on the Command Line.” For a description of libraries and library functions, as well as precompiled object files, available for inclusion in your project, please refer to the MPLAB C17 Libraries (DS51296). apRNOVM^-page 36 PROJECT WINDOW – ex1.pjt  2002 Microchip Technology Inc. ...

Page 43

... MPLAB C17 may be used alone to compile individual C source files into object files. Or, it may be used in conjunction with MPLINK linker to create HEX files. Figure 4-1 shows a generic use of the MPLAB C17 compiler tool.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’ ...

Page 44

... Types of precomp.o Source Files ASSEMBLER/ COMPILER Object Files Library & Linker Script device.lkr Files LINKER Output prog.map Files PROGRAMMERS into the main.c ) for use with prog.hex for input into MPLINK linker.  2002 Microchip Technology Inc. ...

Page 45

... When no command line parameters are specified, or with ‘ displayed describing the command line usage and options. Options to MPLAB C17 can be specified with either ‘ the table.  2002 Microchip Technology Inc. exists in the current directory, it can be compiled with test.c -? ’ or ‘ ...

Page 46

... MOVLW instructions. 17C44 Select to compile for the designated processor. – Suppress the sign-on banner (Quiet mode). 2 Set compiler message level. 1 display errors only 2 display errors and warnings 3 display errors, warnings and messages . Description  2002 Microchip Technology Inc. ...

Page 47

... PICmicro MCU. The second file is .hex error file containing any error messages and/or warnings that the compiler generates during compilation. This file is only created when there are errors. These messages are also displayed on the screen.  2002 Microchip Technology Inc. c:\mcc\h c:\mcc\lib c:\mcc\lkr c:\mcc\bin ...

Page 48

... Specific linker -l , found in the p17c756s.lkr is ex1.map  2002 Microchip Technology Inc. ...

Page 49

... LIBRARY INFORMATION For a description of libraries and precompiled object functions, as well as library files, available for inclusion in your project, please refer to the MPLAB C17 C Compiler Libraries (DS51296).  2002 Microchip Technology Inc. Part 1 Part 2 Part ...

Page 50

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 44  2002 Microchip Technology Inc. ...

Page 51

... Section 2 – MPLAB C17 Advanced Usage Chapter 5. Runtime Environment............................................................47 Chapter 6. Data Types..............................................................................59 Chapter 7. Device Support Files .............................................................61 Chapter 8. Interrupts ................................................................................65 Chapter 9. Mixing Assembly Language and C Modules .......................71 Chapter 10. Writing Efficient Code .........................................................75  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE DS51290A-page 45 Part ...

Page 52

... MPLAB C17 C Compiler User’s Guide apRNOVM^-page 46  2002 Microchip Technology Inc. ...

Page 53

... Contents”. Sections are absolute, assigned or unassigned. See the MPLINK linker portion of the MPASM™ User's Guide with MPLINK™ and MPLIB™ (DS33014) for more on section allocation.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE ...

Page 54

... The compiler temporary variables for interrupt function section _tmpsection_foo apRNOVM^-page 48 usage (e.g., for memory-mapped peripherals) see romdata udata function_name. . #pragma sectiontype section is a .stringtable section named . For _tmpstore section named udata will be placed in the foo udata  2002 Microchip Technology Inc. ...

Page 55

... Initialize some registers to 0 TRISB = 0; TRISC = 0; } Note: The space shown between the two underlines preceding STARTUP() is for illustration and should not be used in actual code (i.e., there should be no space)  2002 Microchip Technology Inc. Runtime Environment Default Name .code_filename .romdata_filename .udata_filename .idata_filename upon RESET ...

Page 56

... USE_INITDATA defined by default. _ _STARTUP() function of the C program. There are no main() . main() via a main() goto or and link. c0s17.asm auto ), the variable is allocated in data , or use directly. idata17.o directly. c0s17 use directly. idata17.o and/or copies initialized data, and , i.e.;  2002 Microchip Technology Inc. ...

Page 57

... Statically allocated initialized global data goes here. Used for data memory allocation. • romdata: Variables declared with the program memory allocation.  2002 Microchip Technology Inc. Runtime Environment Device Description near rom – program memory ≤ 8K, near ram – data memory ≤ 256 far rom – ...

Page 58

... These regions are those that can SHAREBANK // all accesses to these // will be unbanked and to control the allocated stack size and its SIZE RAM keyword will be near romdata directive. The STACK STACK  2002 Microchip Technology Inc. ...

Page 59

... In general, a function which only manipulates stack-based local variables and stack-based parameters is reentrant. References to global variables or the use of static parameters or static local variables may cause a function be non-reentrant.  2002 Microchip Technology Inc. Runtime Environment statement at the last location on the stack. If the program breaks, ...

Page 60

... Table 5.2: Interrupt Example <Available> 0xFB 0xFC save_WREG 0xFD <Reserved> 0xFE <Reserved> 0xFF apRNOVM^-page 54 . and . save_WREG Bank 0 Bank 1 <Available> <Available> <Available> save_BSR <Reserved> <Reserved> . save_ALUSTA Bank 2 Bank 3 <Available> <Available> <Available> <Available> <Available> <Available> <Reserved> save_PCLATH <Reserved> save_ALUSTA  2002 Microchip Technology Inc. ...

Page 61

... The program enters into an infinite loop when it reaches the while(1) the function where the value of ‘x’ is sent to PORT B and possibly _ _TMR0() displayed on LEDs.  2002 Microchip Technology Inc. Runtime Environment sets the function as the interrupt handler for _ _TMR0() statement. When Timer 0 overflows, program control goes to Part ...

Page 62

... Switch to bank 0 save_1F directive. This places them at the end of the #pragma udata and guarantees they are in bank 0. Since BSR is cleared in save_B ) before restoring them as the interrupt MOVLR 00 , and , save_1E save_PRODL  2002 Microchip Technology Inc. ...

Page 63

... Table reads and writes use the 16-bit TBLAT register for latching data transferred from and to program memory. Since TBLAT is not an addressable register it cannot be saved or restored during interrupts.  2002 Microchip Technology Inc. Runtime Environment apRNOVM^-page 57 Part ...

Page 64

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 58  2002 Microchip Technology Inc. ...

Page 65

... ANSI-89 extension For information on implementation-defined behavior of integers, see 12.5 “Integers”.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER is stored at address 0x12345678 0x56 0x101 0x12 ...

Page 66

... C17 apRNOVM^-page 60 MPLAB C17 FLOATING POINT FORMAT VS IEEE 754 Exponent Byte Byte 0 Byte 1 sxxx xxxx yxxx xxxx xxxx xxxx xxxx xxxx sxxx xxxx xxxx xxxx Byte 2 Byte 3 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx  2002 Microchip Technology Inc. ...

Page 67

... Reset() Rlcf(var,dest,access) Rlncf(var,dest,access) Rrcf(var,dest,access) Rlncf(var,dest,access) Swapf(var,dest,access) Note: ‘var’ must be an 8-bit quantity (e.g., char) and not located on the stack.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER INSTRUCTION MACRO ACTIONS Executes a no operation (NOP). Clears the watchdog timer (CLRWDT). ...

Page 68

... Sets ‘func' as the handler for the T0CKI interrupt. Sets ‘func' as the handler for the PIV interrupt. p17c756.asm c:\mcc\lib PIC17C44 PORT A DEFINITION DATA H'010 010h 1 ; 011h p17c756.h directory, c:\mcc\h Action compiles to , p17c756.o directory and c:\mcc\src\proc directory, where is the c:\mcc as: p17c44.asm  2002 Microchip Technology Inc. ...

Page 69

... The Port A retains values assigned to it. The bank switching instruction prior to access.  2002 Microchip Technology Inc. Device Support Files PORTAbits in bank 0). So the above definition reserves 1 010h at location ...

Page 70

... SFR at link time.) Example 7.1 would use: p17c756a.lkr See MPASM™ User's Guide with MPLINK™ and MPLIB™ (DS33014) for more information on using linker scripts. apRNOVM^-page 64 to which starts the timer. TMR1ON 1  2002 Microchip Technology Inc. Timer ‘ ...

Page 71

... The in-line assembler differs from the stand-alone assembler as follows: • No directive support. • Full text mnemonics must be used for table reads/writes (i.e., TABLWT). • No defaults for instruction parameters. All parameters must be fully specified.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER ...

Page 72

... C module ; also defined in C module ; put 0xffff in the C declared ; variable ; export so linker can see it RES byte variable ; export so linker can see it implemented at end the compiler install c:\mcc , and how asm_function . as required to use , main .  2002 Microchip Technology Inc. ...

Page 73

... FSR0 pointing at the return value. ; We'll just reuse the space ; allocated for the argument since we're already ; pointed there. movwf 0x00 return END  2002 Microchip Technology Inc. c:\mcc\examples\example3 where the parameter is taken off of call_asm.asm calls the with a parameter. call_c.c asm_function ...

Page 74

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 68  2002 Microchip Technology Inc. ...

Page 75

... Nesting Interrupts – MPLAB C17 does not support nested interrupts. • Enabling/Disabling Interrupts – Enabling and disabling interrupt sources occurs at two levels: globally and individually. These concepts are discussed in 9.8 “Enabling/Disabling Interrupts” and covered in more detail in Chapter 11.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’ ...

Page 76

... Place the interrupt code the function prototype immediately after the pragma. apRNOVM^-page 70 pragma to declare C functions as ISR’s. The syntax for the pragma is as follows. function-name [section-name] pragma before the C function that is serving as the ISR. Then,  2002 Microchip Technology Inc. ...

Page 77

... Install the interrupt service routine for TMR0 Overflow interrupt. // -------------------------------------------------------------------- Install_TMR0(TMR0_interrupt_service_routine); // -------------------------------------------------------------------- // Install the interrupt service routine for an external interrupt on // the T0CKI pin. // -------------------------------------------------------------------- Install_T0CKI(T0CKI_interrupt_service_routine); // -------------------------------------------------------------------- // Install the interrupt service routine for all peripheral interrupts. // -------------------------------------------------------------------- Install_PIV(PIV_interrupt_service_routine); }  2002 Microchip Technology Inc. Interrupts // peripheral ISR apRNOVM^-page 71 Part 1 Part 2 Part 3 Part 4 ...

Page 78

... The programmer should not attempt to modify the GLINTD bit within the ISR routine. 9.8 ENABLING/DISABLING INTERRUPTS The PIC17 devices contain 18 sources of interrupts. All interrupts are initially disabled. apRNOVM^-page 72 ISR LATENCY TIMES (CYCLES) Small Memory Model * Large Memory Model *  2002 Microchip Technology Inc. ...

Page 79

... For PIC17CXX devices, the CPUSTA register contains the Global Interrupt Disable (GLINTD) bit. Setting this bit (value on RESET) disables all interrupts. You have the capability to: • Enable/disable global interrupts • Enable/disable individual interrupt(s) The details of how to enable and disable interrupts is discussed in Chapter 11.  2002 Microchip Technology Inc. Interrupts Part 1 Part 2 ...

Page 80

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 74  2002 Microchip Technology Inc. ...

Page 81

... Use of section pragma’s to effectively manage RAM and ROM. Refer to 7.3 “Processor Header File” for information on the pragma directive. For examples of use, see the MPLINK linker examples found in the MPASM™ User's Guide with MPLINK™ and MPLIB™ (DS33014).  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER , the following implications arise: directive can yield excellent results ...

Page 82

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 76  2002 Microchip Technology Inc. ...

Page 83

... Section 3 – References Chapter 11. Enabling/Disabling Interrupts.............................................79 Chapter 12. Implementation-Defined Behavior....................................113 Chapter 13. MPLAB C17 Diagnostics ...................................................117  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE DS51290A-page 77 Part 1 Part 2 Part 3 Part 4 ...

Page 84

... MPLAB C17 C Compiler User’s Guide apRNOVM^-page 78  2002 Microchip Technology Inc. ...

Page 85

... All Interrupts on the PIC17 devices are initially disabled. The CPUSTA register contains the Global Interrupt Disable (GLINTD) bit. Setting this bit (value on RESET) disables all interrupts. Enabling interrupts requires: • Enabling global interrupts • Enabling individual interrupt(s)  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE ...

Page 86

... External Interrupt on T0CKI Pin Flag (T0CKIF) bit – [INTSTA<6>]. This clears any previous occurrences of external interrupts on the T0CKI pin. You must set the INTSTA register’s External Interrupt on T0CKI Pin Enable (T0CKIE) bit – [INTSTA<2>]. INTSTAbits.T0CKIF = 0; INTSTAbits.T0CKIE = 1; apRNOVM^-page 80 header file and call the int16.h  2002 Microchip Technology Inc. ...

Page 87

... External Interrupt on RA0/INT Pin Flag (INTF) bit – [INTSTA<4>]. This clears any previous occurrence of external interrupts on the RA0/INT pin. You must set the INTSTA register’s External Interrupt on RA0/INT Pin Enable (INTE) bit – [INTSTA<0>]. INTSTAbits.INTF = 0; INTSTAbits.INTE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. OpenRA0INT Part ...

Page 88

... T0_PS_1_256 ’s that exist in #define #define function. The function OpenTimer0 header file for timers16.h Prescale Value 1:1 1:2 1:4 1:8 1:16 1:32 1:64 1:128 1:256 header file for timers16.h Prescale Value External (I/O pin) OSC Internal (T )  2002 Microchip Technology Inc. ...

Page 89

... TMR0 overflow interrupts. You must set the INTSTA register’s TMR0 Overflow Interrupt Enable (T0IE) bit – [INTSTA<1>]. INTSTAbits.T0IF = 0; INTSTAbits.T0IE = 1; To reset Timer0, you must clear the TMR0L and TMR0H registers. TMR0L = 0; TMR0H = 0;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts 0000 0001 0010 0011 0100 ...

Page 90

... Timer2:Timer1 Mode Timer1 and Timer2 individual 8-bit timers Timer1 and Timer2 16-bit single timer function OpenTimer1 header file for timers16.h Clock Source External (I/O pin) OSC Internal (T ) header file for timers16.h  2002 Microchip Technology Inc. ...

Page 91

... The Peripheral Interrupt Enable Register’s (PIE) TMR1 Interrupt Enable (TMR1IE) bit – [PIE<4>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. TCON2bits.TMR1ON = 0; PIRbits.TMR1IF = 0; PIEbits.TMR1IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts Part 1 Part 2 Part 3 Part ...

Page 92

... TCLK12 pin) the Timer2 Clock Source Select (TMR2CS) bit – [TCON1<1>]. #ifdef _EXTERNAL_CLOCK TCON1bits.TMR2CS = 1; #else TCON1bits.TMR2CS = 0; #endif apRNOVM^-page 86 function. The OpenTimer2 ’s that exist in #define #define function OpenTimer2 header file for timers16.h Clock Source External (I/O pin) OSC Internal (T )  2002 Microchip Technology Inc. ...

Page 93

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. TCON2bits.TMR2ON = 0; PIRbits.TMR2IF = 0; PIEbits.TMR2IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1; ALL PIC17 DEVICES To reset Timer2, clear the TMR2 register. TMR2 = 0; To start Timer2, set the Timer2 On (TMR2ON) bit – [TCON2<1>]. TCON2bits.TMR2ON = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts Part 1 Part 2 Part 3 Part 4 apRNOVM^-page 87 ...

Page 94

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. TCON2bits.TMR3ON = 0; PIR1bits.TMR3IF = 0; PIE1bits.TMR3IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1; apRNOVM^-page 88 function. The OpenTimer3 ’s that exist in #define #define function OpenTimer3 header file for timers16.h Clock Source External (I/O pin) Internal (T OSC )  2002 Microchip Technology Inc. ...

Page 95

... The Peripheral Interrupt Enable Register1’s (PIE1’s) PORTB Interrupt on Change Enable (RBIE) bit – [PIE1<7>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. PIR1bits.RBIF = 0; PIE1bits.RBIE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. OpenPORTB Part 1 Part ...

Page 96

... OpenCapture1(CAPTURE_INT_ON | C1_EVERY_16_RISE_EDGE); #endif apRNOVM^-page 90 function. The OpenCapture1 ’s that exist in #define #define Every falling edge Every rising edge Every fourth rising edge Every sixteenth rising edge OpenCapture1 header file for captur16.h Edge Selection  2002 Microchip Technology Inc. ...

Page 97

... The Peripheral Interrupt Enable Register1’s (PIE1’s) Capture1 Interrupt Enable (CA1IE) bit – [PIE1<2>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. TCON2bits.CA1OVF = 0; PIR1bits.CA1IF = 0; PIE1bits.CA1IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts 00 Every falling edge 01 Every rising edge 10 Every fourth rising edge ...

Page 98

... OpenCapture2(CAPTURE_INT_ON | C2_EVERY_16_RISE_EDGE); #endif apRNOVM^-page 92 function. The OpenCapture2 ’s that exist in #define #define Every falling edge Every rising edge Every fourth rising edge Every sixteenth rising edge OpenCapture2 header file for captur16.h Edge Selection  2002 Microchip Technology Inc. ...

Page 99

... The Peripheral Interrupt Enable Register1’s (PIE1’s) Capture2 Interrupt Enable (CA2IE) bit – [PIE1<3>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. TCON2bits.CA2OVF = 0; PIR1bits.CA2IF = 0; PIE1bits.CA2IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts 00 Every falling edge 01 Every rising edge 10 Every fourth rising edge ...

Page 100

... OpenCapture3(CAPTURE_INT_ON | C3_EVERY_16_RISE_EDGE); #endif apRNOVM^-page 94 function. The OpenCapture3 ’s that exist in #define #define Every falling edge Every rising edge Every fourth rising edge Every sixteenth rising edge OpenCapture3 header file for captur16.h Edge Selection  2002 Microchip Technology Inc. ...

Page 101

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. TCON3bits.CA3OVF = 0; PIR2bits.CA3IF = 0; PIE2bits.CA3IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1; 11.3.2.11 CAPTURE4 INTERRUPT Note: PIC17C7XX devices only. There are two ways to enable the Capture4 Interrupt:  2002 Microchip Technology Inc. Enabling/Disabling Interrupts 00 Every falling edge 01 Every rising edge 10 Every fourth rising edge 11 ...

Page 102

... Every fourth rising edge Every sixteenth rising edge 00 Every falling edge 01 Every rising edge 10 Every fourth rising edge 11 Every sixteenth rising edge // Reset Edge Selection // Reset Edge Selection OpenCapture4 header file for captur16.h Edge Selection Edge Selection  2002 Microchip Technology Inc. ...

Page 103

... The Peripheral Interrupt Enable Register1’s (PIE1’s) USART1 Transmit Interrupt Enable (TX1IE) bit – [PIE1<1>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. PIR1bits.TX1IF = 0; PIE1bits.TX1IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. The OpenUSART1 OpenUSART1 Part 1 ...

Page 104

... The Peripheral Interrupt Enable Register1’s (PIE1’s) USART1 Receive Interrupt Enable (RC1IE) bit – [PIE1<0>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. PIR1bits.RC1IF = 0; PIE1bits.RC1IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1; apRNOVM^-page 98 function. The OpenUSART1 OpenUSART1  2002 Microchip Technology Inc. function ...

Page 105

... The Peripheral Interrupt Enable Register2’s (PIE2’s) USART2 Transmit Interrupt Enable (TX2IE) bit – [PIE2<1>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. PIR2bits.TX2IF = 0; PIE2bits.TX2IE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. The OpenUSART2 OpenUSART2 Part 1 ...

Page 106

... The Peripheral Interrupt Enable Register2’s (PIE2’s) Synchronous Serial Port Interrupt Enable (SSPIE) bit – [PIE2<7>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. - PIR2bits.SSPIF = 0; - PIE2bits.SSPIE = 1; - INTSTAbits.PEIF = 0; - INTSTAbits.PEIE = 1; apRNOVM^-page 100 function. The OpenUSART2 OpenUSART2  2002 Microchip Technology Inc. function ...

Page 107

... The Peripheral Interrupt Enable Register2’s (PIE2’s) A/D Module Interrupt Enable (ADIE) bit – [PIE2<5>]. - The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. PIR2bits.ADIF = 0; PIE2bits.ADIE = 1; INTSTAbits.PEIF = 0; INTSTAbits.PEIE = 1;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. The function also allows OpenADC OpenADC Part ...

Page 108

... Library Call To disable the external interrupt on the INT pin through a library call, you must include the header file and call the int16.h #include <int16.h> CloseRA0INT(); apRNOVM^-page 102 header file and call the int16.h function. CloseRA0INT  2002 Microchip Technology Inc. ...

Page 109

... The Peripheral Interrupt Enable Register1’s (PIE1’s) TMR1 Interrupt Enable (TMR1IE) bit – [PIE1<4>]. • The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIE1bits.TMR1IE = 0; INTSTAbits.PEIE = 0;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. CloseTimer0 function CloseTimer1 ...

Page 110

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIEbits.TMR2IE = 0; INTSTAbits.PEIE = 0; apRNOVM^-page 104 //Disable all //peripheral interrupts header file and call the CloseTimer2 //peripheral interrupts //Disable all //peripheral interrupts function.  2002 Microchip Technology Inc. ...

Page 111

... There are two ways to disable the PORTB Interrupt on Change: Library Call To disable the PORTB interrupt on change through a library call, you must include the header file and call the port16.h #include <port16.h> ClosePORTB();  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. CloseTimer3 //peripheral interrupts //Disable all //peripheral interrupts function ...

Page 112

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIE1bits.CA1IE = 0; INTSTAbits.PEIE = 0; apRNOVM^-page 106 //Disable all //peripheral interrupts //Disable all //peripheral interrupts function. CloseCapture1 //Disable all //peripheral interrupts  2002 Microchip Technology Inc. ...

Page 113

... The Peripheral Interrupt Enable Register’s (PIE) Capture2 Interrupt Enable (CA2IE) bit – [PIE<3>]. • The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIEbits.CA2IE = 0; INTSTAbits.PEIE = 0;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts //Disable all //peripheral interrupts function. CloseCapture2 ...

Page 114

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIE2bits.CA4IE = 0; INTSTAbits.PEIE = 0; apRNOVM^-page 108 function CloseCapture3 //Disable all //peripheral interrupts function. CloseCapture4 //Disable all //peripheral interrupts  2002 Microchip Technology Inc. ...

Page 115

... There are two ways to disable the USART1 Receive Interrupt: Library Call To disable the USART1 Receive Interrupt through a library call, you must include the header file and call the usart16.h #include <usart16.h> CloseUSART1();  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. CloseUSART1 //Disable all //peripheral interrupts //Disable all //peripheral interrupts function ...

Page 116

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIE2bits.TX2IE = 0; INTSTAbits.PEIE = 0; apRNOVM^-page 110 //Disable all //peripheral interrupts //Disable all //peripheral interrupts function. CloseUSART2 //Disable all //peripheral interrupts  2002 Microchip Technology Inc. ...

Page 117

... Interrupt Enable (SSPIE) bit – [PIE2<7>]. • The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIE2bits.SSPIE = 0; INTSTAbits.PEIE = 0;  2002 Microchip Technology Inc. Enabling/Disabling Interrupts function. CloseUSART2 //Disable all //peripheral interrupts ...

Page 118

... The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>]. Note: Clearing the PEIE bit disables all peripheral interrupts. PIE2bits.ADIE = 0; INTSTAbits.PEIE = 0; apRNOVM^-page 112 //Disable all //peripheral interrupts function. CloseADC //Disable all //peripheral interrupts  2002 Microchip Technology Inc. ...

Page 119

... The value of the integer character constant is the 8-bit value of the first character. Wide characters are not supported.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE ...

Page 120

... The direction of truncation or rounding when a floating point number is converted to a narrower floating point number (3.2.1.4) The rounding to the nearest method is used. apRNOVM^-page 114 has the same range of values signed char  2002 Microchip Technology Inc. ...

Page 121

... Whether a bit-field can straddle a storage-unit boundary (3.5.2.1) A bit-field cannot straddle a storage unit boundary. 12.11 ENUMERATIONS The integer type chosen to represent the values of an enumeration type (3.5.2.2) is used to represent the values of an enumeration type. signed int  2002 Microchip Technology Inc. Implementation-Defined Behavior . unsigned int . unsigned int bit-field. ...

Page 122

... MCC_INCLUDE environment variable. The MCC_INCLUDE environment variable contains a semi-colon delimited list of directories to search. The behavior on each recognized #pragma directive (3.8.6) Each #pragma apRNOVM^-page 116 #include <filename> #include “filename” directive is listed in 2.6 “Statement Differences”. mechanism are mechanism are  2002 Microchip Technology Inc. ...

Page 123

... The compiler was unable to locate the ‘%s’ file. Common causes include misspelled file ‘%s’ and misconfigured include path.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’ ...

Page 124

... Bitwise operators require that both operands be of integer type. Common causes include a missing ‘*’ or ‘[ ]’ operator. apRNOVM^-page 118  2002 Microchip Technology Inc. ...

Page 125

... Microchip Technology Inc. Implementation-Defined Behavior Part 1 Part 2 ...

Page 126

... Microchip Technology Inc. ...

Page 127

... A function call has been made without an in-scope function prototype for the function being called. This can be un-safe type-checking for the function arguments can be performed. 2007: unknown pragma ‘%s’ encountered  2002 Microchip Technology Inc. Implementation-Defined Behavior Part 1 Part ...

Page 128

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 122  2002 Microchip Technology Inc. ...

Page 129

... Section 4 – Appendices Appendix A. Reference Documents......................................................125 Appendix B. Example Programs ...........................................................127 Appendix C. ASCII Character Set..........................................................129  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE DS51290A-page 123 Part 1 Part 2 Part 3 Part 4 ...

Page 130

... MPLAB C17 C Compiler User’s Guide apRNOVM^-page 124  2002 Microchip Technology Inc. ...

Page 131

... A best selling authoritative reference for the C programming language. Van Sickle, Ted. Programming Microcontrollers in C, First Edition. LLH Technology Publishing, Eagle Rock, Virginia 24085. Although this book focuses on Motorola programming with C for microcontrollers is useful.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’S GUIDE ® ...

Page 132

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 126  2002 Microchip Technology Inc. ...

Page 133

... EXAMPLE DETAILS The types of files typically found in an example subdirectory are as follows: • Source files (.c, .asm) – the main program files. • Batch files (.bat) – for use with command-line applications.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER directory after you have installed MPLAB ...

Page 134

... Could not open source file '<filename>'. This file will not be present in the list file.” This comes from using precompiled libraries, where the source for these libraries is not in the default directory ( apRNOVM^-page 128 ). c:\mcc\src  2002 Microchip Technology Inc. ...

Page 135

... Appendix C. ASCII Character Set Hex 0 0 NUL 1 SOH 2 STX 3 ETX 4 EOT 5 ENQ 6 ACK 7 Bell  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER Most Significant Character DLE Space 0 @ DC1 ! 1 A DC2 " DC3 # 3 C DC4 $ 4 D NAK % 5 E SYN & ETB ’ ...

Page 136

... MPLAB C17 C Compiler User’s Guide NOTES: apRNOVM^-page 130  2002 Microchip Technology Inc. ...

Page 137

... A section which has been assigned to a target memory block in the linker command file. The linker allocates an assigned section into its specified target memory block. Asynchronous Stimulus (Simulators) Data generated to simulate external inputs to a simulator device.  2002 Microchip Technology Inc. ® MPLAB C17 C COMPILER USER’ ...

Page 138

... On a PICmicro MCU device, data memory (RAM) is comprised of General Purpose Registers (GPRs) and Special Function Registers (SFRs). Some devices also have EEPROM data memory. apRNOVM^-page 132 ® ICE 2000, MPLAB ICD, MPLAB ICD 2) ® IDE v5.xx/v6.xx) ® microcontroller modes of  2002 Microchip Technology Inc. ...

Page 139

... Expressions are used in the operand field of the source line and may contain constants, symbols, or combinations of constants and/or symbols separated by arithmetic or logical operators. Each constant or symbol may be preceded by a plus or minus to indicate a positive or negative expression.  2002 Microchip Technology Inc. Glossary apRNOVM^-page 133 ...

Page 140

... However, if the current instruction changes the program counter, this prefetched instruction is explicitly ignored, causing a forced NOP cycle. G GPR General Purpose Register. The portion of PICmicro MCU data memory (RAM) available for general use, e.g., program-specific variables. apRNOVM^-page 134  2002 Microchip Technology Inc. ...

Page 141

... A sequence of bits that tells a central processing unit to perform a particular operation and can contain data to be used in the operation. Instruction Set (Language Tools) The collection of machine language instructions that a particular processor understands.  2002 Microchip Technology Inc. Glossary ® apRNOVM^-page 135 ...

Page 142

... Such an input may be either "level sensitive" – the interrupt condition will persist as long as the input is active or "edge triggered" – an interrupt is signaled by a low-to-high or high-to-low transition on the input. Some processors have several interrupt request inputs allowing different priority interrupts. apRNOVM^-page 136  2002 Microchip Technology Inc. ...

Page 143

... Instructions are binary strings. The collection of all possible instructions for a particular processor is known as its "instruction set". Machine Language A set of instructions for a specific central processing unit, designed to be usable by a processor without being translated. Also called machine code.  2002 Microchip Technology Inc. Glossary apRNOVM^-page 137 ...

Page 144

... Instructions that are translated directly into machine code. Mnemonics are used to perform arithmetic and logical operations on data residing in program or data memory of a microcontroller. They can also move data in and out of registers and memory as well as change the flow of program execution. Also referred to as Opcodes. apRNOVM^-page 138  2002 Microchip Technology Inc. ...

Page 145

... MPASM Assembler Microchip Technology’s relocatable macro assembler. MPASM assembler is a command-line or Windows-based PC application that provides a platform for developing assembly language code for Microchip’s PICmicro microcontroller (MCU) families assembler will refer to the entire development platform including the macro assembler and utility functions. ...

Page 146

... Mode provides the Off-Chip Memory selection dialog box. Opcodes Operational Codes. See Mnemonics. Operators Arithmetic symbols, like the plus sign ‘+’ and the minus sign ‘-’, that are used when forming well-defined expressions. Each operator has an assigned precedence. apRNOVM^-page 140  2002 Microchip Technology Inc. ...

Page 147

... The memory area in a microcontroller where instructions are stored. Also, the memory in the emulator or simulator containing the downloaded target application firmware. Programmer A device used to program electrically programmable semiconductor devices such as microcontrollers.  2002 Microchip Technology Inc.   Windows 2000.  ...

Page 148

... The process of converting an instruction to an identical, but smaller instruction. This is useful for saving on code size. The assembler currently knows how to RELAX a CALL instruction into an RCALL instruction. This is done when the symbol that is being called is within +/- 32k instruction words from the current instruction. apRNOVM^-page 142  2002 Microchip Technology Inc. ...

Page 149

... The trace buffer captures the information that is on the bus at one instance. Therefore, one trace buffer entry will contain execution information for three instructions. The number of captured cycles from one piece of information to another for a single instruction execution is referred to as the skew.  2002 Microchip Technology Inc. Glossary apRNOVM^-page 143 ...

Page 150

... Step Into (MPLAB IDE v5.xx/v6.xx) This command is the same as Single Step. Step Into (as opposed to Step Over) follows a CALL instruction into a subroutine. apRNOVM^-page 144  2002 Microchip Technology Inc. ...

Page 151

... Lines of text that you build for inserting into your files at a later time. The MPLAB Editor stores templates in template files. Tool Bar (MPLAB IDE v5.xx/v6.xx) A row or column of icons that you can click on to execute MPLAB IDE functions.  2002 Microchip Technology Inc. Glossary apRNOVM^-page 145 ...

Page 152

... Watch Variable (MPLAB IDE v5.xx/v6.xx) A variable that you may monitor during a debugging session in a watch window. Watch Window (MPLAB IDE v5.xx/v6.xx) Watch windows contain a list of watch variables that are updated at each breakpoint. apRNOVM^-page 146 ??( ??) ??< ??> ??= [ ] { } # ??/ ??' ??! ??- \ ^ | ~  2002 Microchip Technology Inc. ...

Page 153

... Assembly Language, Mixing with C ............... 90 Assembly, Inline ............................................. 91 Attributes Overlay ............................................... 66, 70 Shared ............................................... 66, 71 AUTOEXEC.BAT ............................................ 24 B Banked/Paged Data ....................................... 69 bin directory .............................................. 24, 59 Bit-Fields ........................................................ 35 ANSI C ................................................... 139  2002 Microchip Technology Inc. ® ® MPLAB MPLAB C17 C COMPILER C17 C COMPILER USER’S GUIDE USER’S GUIDE Index BSR .......................................................... 73 Programming References ...

Page 154

... Make Project ...................................................50 Map File ..............................................39, 57, 61 MCC_INCLUDE ..................................24, 28, 59 mcc17 ..................................................23, 37, 58 mcc17d ......................................................23, 37 Memory Models ................................................47, 69 Requirements ...........................................23 Microchip Internet Web Site ..............................9 MPLAB C17 Description .........................19, 164 MPLAB C17 Libraries ........................................8 MPLAB C17 vs. ANSI C ..................................25 MPLAB ICE .....................................................19 MPLAB IDE .........................................19, 24, 40  2002 Microchip Technology Inc. ...

Page 155

... RAM Address Spaces ....................................... 34 Pointers .............................................. 34, 35 ram ............................................... 27, 33, 69 Ranges, Integer Types ................................... 78 README File ................................................... 8 References ....................................................... 8 Register Definitions ................ 39, 47, 57, 60, 80 Registers, ANSI C ........................................ 138 Reserved Resources ...................................... 23  2002 Microchip Technology Inc. Reset( ) ........................................................... 79 Rlcf( ) .............................................................. 79 Rlncf( ) ............................................................ 79 ROM Address Spaces ....................................... 34 Pointers .............................................. 34, 35 rom ............................................... 27, 33, 69 String ........................................................ 34 romdata .................................................... 65, 70 Rrcf( ) .............................................................. 79 ...

Page 156

... USE_INITDATA .............................................. 68 USE_STARTUP .............................................. 68 Using SFR’s .................................................... 82 V Variables ......................................................... 31 Versions, Compiler ......................................... 23 volatile ....................................................... 81 Warnings ....................................................... 145 Watchdog Timer (WDT) .................................. 79 WREG ..................................... 33, 73, 75, 84, 87 Writing an Interrupt Service Routine ............... 84 Writing Efficient Code ..................................... 93 Writing the Interrupt Vector ............................. 85 WWW Address ................................................. 9 DS51290A-page 150  2002 Microchip Technology Inc. ...

Page 157

... NOTES:  2002 Microchip Technology Inc. Index DS51290A-page 151 ...

Page 158

... MPLAB C17 C Compiler User’s Guide NOTES: DS51290A-page 152  2002 Microchip Technology Inc. ...

Page 159

... NOTES:  2002 Microchip Technology Inc. Index DS51290A-page 153 ...

Page 160

... Korea Microchip Technology Korea 168-1, Youngbo Bldg. 3 Floor Samsung-Dong, Kangnam-Ku Seoul, Korea 135-882 Tel: 82-2-554-7200 Fax: 82-2-558-5934 Singapore Microchip Technology Singapore Pte Ltd. 200 Middle Road #07-02 Prime Centre Singapore, 188980 Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan Microchip Technology (Barbados) Inc., Taiwan Branch 11F-3, No ...

Related keywords