Abl-electronic PIC Microcontrollers PIC16 Manual de usuario

Busca en linea o descarga Manual de usuario para Ordenadores Abl-electronic PIC Microcontrollers PIC16. ABL electronic PIC Microcontrollers PIC16 User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 312
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 0
mikroC
Develop your applications quickly and easily with the world's
most intuitive C compiler for PIC Microcontrollers (families
PIC12, PIC16, and PIC18).
Highly sophisticated IDE provides the power you need with the
simplicity of a Windows based point-and-click environment.
With useful implemented tools, many practical code examples,
broad set of built-in routines, and a comprehensive Help, mikroC
makes a fast and reliable tool, which can satisfy needs of experi-
enced engineers and beginners alike.
C Compiler for Microchip PIC microcontrollers
mikroElektronika
Development tools - Books - Compilers
www.mikroelektronika.co.yu
Users
manual
Making it simple
Vista de pagina 0
1 2 3 4 5 6 ... 311 312

Indice de contenidos

Pagina 1 - Making it simple

mikroCDevelop your applications quickly and easily with the world'smost intuitive C compiler for PIC Microcontrollers (familiesPIC12, PIC16, and

Pagina 2 - Reader’s note

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...2MikroElektronika: Development tools - Books - CompilerspagemikroC

Pagina 3 - Table of Contents

Typedef SpecifierSpecifier typedef introduces a synonym for a specified type. You can use type-def declarations to construct shorter or more meaningfu

Pagina 4

asm DeclarationC allows embedding assembly in the source code by means of asm declaration.Declarations _asm and __asm are also allowed in mikroC, and

Pagina 5

InitializationAt the time of declaration, you can set the initial value of a declared object, i.e.initialize it. Part of the declaration which specifi

Pagina 6

Functions are central to C programming. Functions are usually defined as subpro-grams which return a value based on a number of input parameters. Retu

Pagina 7

Within parentheses, parameter-declarator-listis a list of formal argumentsthat function takes. These declarators specify the type of each function par

Pagina 8

Function DefinitionFunction definition consists of its declaration and a function body. The functionbody is technically a block – a sequence of local

Pagina 9 - QUICK OVERVIEW

Function CallsA function is called with actual arguments placed in the same sequence as theirmatching formal parameters. Use a function-call operator

Pagina 10

If a prototype is present, the number of arguments must match. The types need tobe compatible only to the extent that an assignment can legally conver

Pagina 11 - CODE EDITOR

Operators are tokens that trigger some computation when applied to variables andother objects in an expression.mikroC recognizes following operators:-

Pagina 12

MikroElektronika: Development tools - Books - Compilers101pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prec

Pagina 13 - Uncomment Icon

MikroElektronika: Development tools - Books - Compilers3pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...The Co

Pagina 14 - CODE EXPLORER

Arithmetic OperatorsArithmetic operators are used to perform mathematical computations. They havenumerical operands and return numerical results. Type

Pagina 15 - DEBUGGER

Binary Arithmetic OperatorsDivision of two integers returns an integer, while remainder is simply truncated:/* for example: */7 / 4; // equals

Pagina 16 - Watch Window

Relational OperatorsUse relational operators to test equality or inequality of expressions. If the expres-sion evaluates to true, it returns 1; otherw

Pagina 17

Bitwise OperatorsUse the bitwise operators to modify the individual bits of numerical operands.Bitwise operators associate from left to right. The onl

Pagina 18

/* Similarly: */0x1234 | 0x5678;/* equals 0x567C */0x1234 ^ 0x5678;/* equals 0x444C */~ 0x1234;/* equals 0xEDCB */Bitwise Shift OperatorsBinary operat

Pagina 19 - ERROR WINDOW

Logical OperatorsOperands of logical operations are considered true or false, that is non-zero orzero. Logical operators always return 1 or 0. Operand

Pagina 20 - STATISTICS

Logical Expressions and Side EffectsGeneral rule with complex logical expressions is that the evaluation of consecutivelogical operands stops the very

Pagina 21

Conditional Operator ? :The conditional operator ? : is the only ternary operator in C. Syntax of the con-ditional operator is:expression1? expression

Pagina 22

4. Both of type pointer to qualified or unqualified versions of compatible types. The resulting type is a pointer to a type qualified with all the typ

Pagina 23 - INTEGRATED TOOLS

Thus, we have 10 different compound assignment operators: +=, -=, *=, /=,%=, &=, |=, ^=, <<=, and >>=. All of these associate from rig

Pagina 24

Code Assistant [CTRL+SPACE]If you type a first few letter of a word and then press CTRL+SPACE, all the valididentifiers matching the letters you typed

Pagina 25

Sizeof OperatorPrefix unary operator sizeof returns an integer constant that gives the size inbytes of how much memory space is used by its operand (d

Pagina 26 - KEYBOARD SHORTCUTS

An expression is a sequence of operators, operands, and punctuators that specifiesa computation. Formally, expressions are defined recursively: subexp

Pagina 27

Binary operator comma (,) has the lowest precedence and associates from left toright, so that a, b, c is same as (a, b), c. This allows us to write se

Pagina 28

Statements specify the flow of control as a program executes. In the absence ofspecific jump and selection statements, statements are executed sequent

Pagina 29 - Applications

Expression StatementsAny expression followed by a semicolon forms an expression statement:expression;mikroC executes an expression statement by evalua

Pagina 30 - PROJECTS

Nested if statementsNested if statements require additional attention. General rule is that the nestedconditionals are parsed starting from the innerm

Pagina 31 - SOURCE FILES

Upon finding a match, program flow continues normally: following instructionswill be executed in natural order regardless of the possible case label.

Pagina 32 - New File

Iteration StatementsIteration statements let you loop a set of statements. There are three forms of itera-tion statements in C: while, do, and for.Whi

Pagina 33 - Close File

Do StatementThe do statement executes until the condition becomes false. Syntax of do state-ment is:dostatementwhile (expression);The statementis exec

Pagina 34 - COMPILATION

All the expressions are optional. If condition-expis left out, it is assumed to bealways true. Thus, “empty” for statement is commonly used to create

Pagina 35 - ERROR MESSAGES

Auto CorrectThe Auto Correct feature corrects common typing mistakes. To access the list ofrecognized typos, select Tools > Options from the drop-d

Pagina 36 - Compiler Warning Messages

Jump StatementsA jump statement, when executed, transfers control unconditionally. There are foursuch statements in mikroC: break, continue, goto, and

Pagina 37 - Reference

You can use goto to break out from any level of nested control structures. But,goto cannot be used to jump into block while skipping that block’s init

Pagina 38 - PIC SPECIFICS

Compound Statements (Blocks)A compound statement, or block, is a list (possibly empty) of statements enclosedin matching braces {}. Syntactically, a b

Pagina 39 - PIC16 Specifics

Preprocessor is an integrated text processor which prepares the source code forcompiling. Preprocessor allows:- inserting text from a specifed file to

Pagina 40 - ANSI Standard Issues

Line Continuation with BackslashIf you need to break directive into multiple lines, you can do it by ending the linewith a backslash (\):#define MACRO

Pagina 41 - Accessing Individual Bits

A macro won’t be expanded during its own expansion (so #define MACROMACROwon’t expand indefinitely).Let’s have an example:/* Here are some simple macr

Pagina 42 - Interrupts

Macros with ParametersThe following syntax is used to define a macro with parameters:#define macro_identifier(<arg_list>) token_sequenceNote the

Pagina 43 - Linker Directives

Here is a simple example:// A simple macro which returns greater of its 2 arguments:#define _MAX(A, B) ((A) > (B)) ? (A) : (B)// Let's call it

Pagina 44 - LEXICAL ELEMENTS

File InclusionThe preprocessor directive #include pulls in header files (extension .h) into thesource code. Do not rely on preprocessor to include sou

Pagina 45 - Comments

Note: There is also a third version of #include directive, rarely used, whichassumes that neither < nor " appears as the first non-whitespace

Pagina 46

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...6MikroElektronika: Development tools - Books - CompilerspageThe Co

Pagina 47 - CONSTANTS

Now, the following code,LCD_PRINT(temp)will be preprocessed to this:Lcd_Out_Cp("temp" ": "); Lcd_Out_Cp(IntToStr(temp));Operator #

Pagina 48

Directives #if, #elif, #else, and #endifThe conditional directives #if, #elif, #else, and #endif work very similar tothe common C conditional statemen

Pagina 49 - Floating Point Constants

Any processed sectioncan contain further conditional clauses, nested to anydepth. Each nested #else, #elif, or #endif directive belongs to the closest

Pagina 50 - Character Constants

CHAPTERMikroElektronika: Development tools - Books - Compilers4mikroC LibrariesmikroC provides a number of built-in and library routines which h

Pagina 51

mikroC compiler provides a set of useful built-in utility functions. Built-in func-tions do not require any header files to be included; you can use t

Pagina 52 - String Constants

MikroElektronika: Development tools - Books - Compilers137pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 53 - Constant Expressions

mikroC provides a set of libraries which simplifies the initialization and use ofPIC MCU and its modules. Library functions do not require any header

Pagina 54 - KEYWORDS

ADC (Analog to Digital Converter) module is available with a number of PICMCU models. Library function Adc_Read is included to provide you comfortable

Pagina 55 - IDENTIFIERS

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...140MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 56 - PUNCTUATORS

mikroC provides a library (driver) for working with the CAN module.CAN is a very robust protocol that has error detection and signalling, self–check-i

Pagina 57 - /* call func with two args */

MikroElektronika: Development tools - Books - Compilers7pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...The so

Pagina 58 - Semicolon

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...142MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 59 - Equal Sign

MikroElektronika: Development tools - Books - Compilers143pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 60 - OBJECTS AND LVALUES

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...144MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 61

MikroElektronika: Development tools - Books - Compilers145pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 62 - SCOPE AND VISIBILITY

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...146MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 63 - Visibility

There is a number of constants predefined in CAN library. To be able to use thelibrary effectively, you need to be familiar with these. You might want

Pagina 64 - NAME SPACES

// ..continued#define CAN_CONFIG_DBL_BUFFER_BIT 0x10#define CAN_CONFIG_DBL_BUFFER_ON 0xFF // XXX1XXXX#define CAN_CONFIG_DBL_BUFFER_OFF 0xEF // XXX

Pagina 65 - DURATION

CAN_RX_MSG_FLAGSCAN_RX_MSG_FLAGS are flags related to reception of CAN message. If a particularbit is set; corresponding meaning is TRUE or else it wi

Pagina 66

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...150MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 67 - Type Categories

MikroElektronika: Development tools - Books - Compilers151pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...// .

Pagina 68 - FUNDAMENTAL TYPES

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...8MikroElektronika: Development tools - Books - CompilerspageToggle

Pagina 69

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...152MikroElektronika: Development tools - Books - CompilerspageRXDV

Pagina 70 - Enumerations

SPI module is available with a number of PICmicros. mikroC provides a library(driver) for working with the external CAN modules (such as MCP2515 orMCP

Pagina 71

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...154MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 72 - Void Type

MikroElektronika: Development tools - Books - Compilers155pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 73 - DERIVED TYPES

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...156MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 74

MikroElektronika: Development tools - Books - Compilers157pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 75

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...158MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 76 - Pointers

MikroElektronika: Development tools - Books - Compilers159pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 77 - /* is same as: */

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...160MikroElektronika: Development tools - Books - Compilerspage// .

Pagina 78 - Pointer Arithmetic

MikroElektronika: Development tools - Books - Compilers161pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...+5VR

Pagina 79

Stopwatch WindowThe Stopwatch Window displays the current count of cycles/time since the lastDebugger action. Stopwatch measures the execution time (n

Pagina 80 - // so a[3] now equals 6

Compact Flash Library provides routines for accessing data on Compact Flashcard (abbrev. CF further in text). CF cards are widely used memory elements

Pagina 81

MikroElektronika: Development tools - Books - Compilers163pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 82 - Structures

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...164MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 83 - // incomplete

MikroElektronika: Development tools - Books - Compilers165pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 84

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...166MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 85 - // identical to (*ps).m

MikroElektronika: Development tools - Books - Compilers167pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 86

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...168MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 87

MikroElektronika: Development tools - Books - Compilers169pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 88 - Bit Fields

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...170MikroElektronika: Development tools - Books - CompilerspageNext

Pagina 89 - // Relevant bits 2, 3, and 4

MikroElektronika: Development tools - Books - Compilers171pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...+5VC

Pagina 90 - TYPES CONVERSIONS

Call Stack WindowThe Call Stack Window keeps track of depth and order of nested routine calls inprogram simulation. Check the Nested Calls Limitations

Pagina 91

EEPROM data memory is available with a number of PICmicros. mikroC includeslibrary for comfortable work with EEPROM.Eeprom_ReadEeprom_WritemikroC- C C

Pagina 92

MikroElektronika: Development tools - Books - Compilers173pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 93 - DECLARATIONS

This library is designed to simplify handling of the underlying hardware(RTL8019AS). However, certain level of knowledge about the Ethernet andEtherne

Pagina 94

MikroElektronika: Development tools - Books - Compilers175pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 95

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...176MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 96 - // Add member declarators

MikroElektronika: Development tools - Books - Compilers177pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 97 - Storage Classes

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...178MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 98

MikroElektronika: Development tools - Books - Compilers179pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 99 - Type Qualifiers

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...180MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 100 - Typedef Specifier

MikroElektronika: Development tools - Books - Compilers181pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 101 - // just a test

MikroElektronika: Development tools - Books - Compilers11pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...In ca

Pagina 102 - Initialization

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...182MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 103 - FUNCTIONS

MikroElektronika: Development tools - Books - Compilers183pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 104 - Function Prototypes

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...184MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 105 - Function Definition

MikroElektronika: Development tools - Books - Compilers185pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 106 - Argument Conversions

This library provides routines for accessing microcontroller Flash memory. Notethat prototypes differ for PIC16 and PIC18 families.Flash_ReadFlash_Wri

Pagina 107 - // function call

The example demonstrates simple data exchange via USART. When PIC MCUreceives data, it immediately sends the same data back. If PIC is connected to th

Pagina 108 - OPERATORS

I²C full master MSSP module is available with a number of PIC MCU models.mikroC provides I2C library which supports the master I²C mode.Note: This lib

Pagina 109

MikroElektronika: Development tools - Books - Compilers189pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 110 - Arithmetic Operators

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...190MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 111

This code demonstrates use of I²C Library functions. PIC MCU is connected(SCL, SDA pins ) to 24c02 EEPROM. Program sends data to EEPROM (data iswritte

Pagina 112 - Relational Operators

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...iiMikroElektronika: Development tools - Books - CompilerspageDISCL

Pagina 113 - Bitwise Operators

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...12MikroElektronika: Development tools - Books - CompilerspageAfter

Pagina 114

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...192MikroElektronika: Development tools - Books - Compilerspage4MHz

Pagina 115 - Logical Operators

mikroC provides library for working with 4x4 keypad; routines can also be usedwith 4x1, 4x2, or 4x3 keypad. Check the connection scheme at the end of

Pagina 116 - /* equals 0 */

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...194MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 117 - Conditional Operator ? :

MikroElektronika: Development tools - Books - Compilers195pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...The

Pagina 118 - Assignment Operators

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...196MikroElektronika: Development tools - Books - Compilerspage4MHz

Pagina 119

mikroC provides a library for communicating with commonly used LCD (4-bitinterface). Figures showing HW connection of PIC and LCD are given at the end

Pagina 120 - Sizeof Operator

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...198MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 121 - EXPRESSIONS

MikroElektronika: Development tools - Books - Compilers199pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 122

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...200MikroElektronika: Development tools - Books - CompilerspageLCD

Pagina 123 - STATEMENTS

MikroElektronika: Development tools - Books - Compilers201pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 124 - Selection Statements

MikroElektronika: Development tools - Books - Compilers13pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Proce

Pagina 125

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...202MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 126

MikroElektronika: Development tools - Books - Compilers203pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...mikr

Pagina 127 - Iteration Statements

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...204MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 128

MikroElektronika: Development tools - Books - Compilers205pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 129 - ;) for a loop body

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...206MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 130 - Jump Statements

MikroElektronika: Development tools - Books - Compilers207pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 131 - /* error handling code */

mikroC provides a library for drawing and writing on Graphic LCD. These rou-tines work with commonly used GLCD 128x64, and work only with the PIC18fam

Pagina 132 - Compound Statements (Blocks)

MikroElektronika: Development tools - Books - Compilers209pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 133 - PREPROCESSOR

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...210MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 134

MikroElektronika: Development tools - Books - Compilers211pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 135 - #define MACRO

RAM WindowSummarizes all GPR and SFR registers and their addresses. Also displays symbol-ic names of variables and their addresses.ROM WindowLists op-

Pagina 136 - Macros with Parameters

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...212MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 137 - Undefining Macros

MikroElektronika: Development tools - Books - Compilers213pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 138 - File Inclusion

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...214MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 139 - Preprocessor Operators

MikroElektronika: Development tools - Books - Compilers215pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 140 - Conditional Compilation

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...216MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 141

MikroElektronika: Development tools - Books - Compilers217pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 142

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...218MikroElektronika: Development tools - Books - Compilerspage118K

Pagina 143

mikroC provides a library for handling Manchester coded signals. Manchestercode is a code in which data and clock signals are combined to form a singl

Pagina 144 - BUILT-IN ROUTINES

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...220MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 145 - Vdelay_ms

MikroElektronika: Development tools - Books - Compilers221pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 146 - LIBRARY ROUTINES

MikroElektronika: Development tools - Books - Compilers15pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...USART

Pagina 147 - ADC Library

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...222MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 148 - Hardware Connection

MikroElektronika: Development tools - Books - Compilers223pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Hard

Pagina 149 - CAN Library

mikroC provides a library for accessing data on Multi Media Card via SPIcommunication.Notes:- Library works with PIC18 family only; - Library function

Pagina 150 - CANGetOperationMode

MikroElektronika: Development tools - Books - Compilers225pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 151 - CANInitialize

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...226MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 152 - CANSetBaudRate

MikroElektronika: Development tools - Books - Compilers227pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 153 - CANSetFilter

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...228MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 154 - CANWrite

MikroElektronika: Development tools - Books - Compilers229pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 155 - CAN Constants

MikroElektronika: Development tools - Books - Compilers230pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 156

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...231MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 157

7 Segment Display DecoderThe 7seg Display Decoder is a convenient visual panel which returns decimal/hexvalue for any viable combination you would lik

Pagina 158

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...232MikroElektronika: Development tools - Books - CompilerspageHard

Pagina 159

OneWire library provides routines for communication via OneWire bus, for exam-ple with DS1820 digital thermometer. This is a Master/Slave protocol, an

Pagina 160

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...234MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 161 - CANSPI Library

MikroElektronika: Development tools - Books - Compilers235pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 162 - CANSPIGetOperationMode

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...236MikroElektronika: Development tools - Books - CompilerspageHard

Pagina 163 - CANSPIInitialize

mikroC provides a library for communicating with common PS/2 keyboard.Thelibrary does not utilize interrupts for data retrieval, and requires oscillat

Pagina 164 - CANSPISetBaudRate

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...238MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 165 - CANSPISetFilter

MikroElektronika: Development tools - Books - Compilers239pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 166 - CANSPIWrite

CCP module is available with a number of PICmicros. mikroC provides librarywhich simplifies using PWM HW Module.Note: These routines support module on

Pagina 167

MikroElektronika: Development tools - Books - Compilers241pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 168

mikroBootloadermikroBootloader can be used only with PICmicros that support flash write.1. Load the PIC with the appropriate hex file using the conven

Pagina 169

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...242MikroElektronika: Development tools - Books - CompilerspageHard

Pagina 170 - Compact Flash Library

RS-485 is a multipoint communication which allows multiple devices to be con-nected to a single signal cable. mikroC provides a set of library routine

Pagina 171 - Cf_Detect

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...244MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 172 - Cf_Disable

MikroElektronika: Development tools - Books - Compilers245pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 173 - Cf_Read_Word

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...246MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 174 - Cf_Find_File

MikroElektronika: Development tools - Books - Compilers247pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 175 - Cf_File_Write_Init

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...248MikroElektronika: Development tools - Books - CompilerspageHard

Pagina 176 - Cf_Set_File_Date

Secure Digital (SD) is a flash memory memory card standard, based on the olderMulti Media Card (MMC) format. SD cards are currently available in sizes

Pagina 177

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...250MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 178

MikroElektronika: Development tools - Books - Compilers251pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 179 - PIC16F877A

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...18MikroElektronika: Development tools - Books - CompilerspageBelow

Pagina 180 - EEPROM Library

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...252MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 181 - Eeprom_Read

MikroElektronika: Development tools - Books - Compilers253pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Hard

Pagina 182 - Ethernet Library

mikroC provides routines which implement software I²C. These routines are hard-ware independent and can be used with any MCU. Software I2C enables you

Pagina 183 - Eth_Set_Ip_Address

MikroElektronika: Development tools - Books - Compilers255pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 184 - Eth_Set_Inport

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...256MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 185 - Eth_Get_Ip_Hdr_Len

MikroElektronika: Development tools - Books - Compilers257pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 186 - Eth_Get_Source_Ip_Address

mikroC provides library which implement software SPI. These routines are hard-ware independent and can be used with any MCU. You can easily communicat

Pagina 187 - Eth_Arp_Response

MikroElektronika: Development tools - Books - Compilers259pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 188 - Eth_Get_Udp_Source_Port

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...260MikroElektronika: Development tools - Books - CompilerspageLibr

Pagina 189 - Eth_Get_Udp_Port

mikroC provides library which implements software UART. These routines arehardware independent and can be used with any MCU. You can easily communi-ca

Pagina 190 - Eth_Send_Udp

Debugger ShortcutsF4 Run to CursorF5 Toggle breakpointF6 Run/Pause DebuggerF7 Step intoF8 Step overF9 DebugCTRL+F2 ResetMikroElek

Pagina 191 - Eth_Get_Tcp_Hdr_Offset

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...262MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 192 - Eth_Set_Tcp_Data

The example demonstrates simple data exchange via software UART. When PICMCU receives data, it immediately sends the same data back. If PIC is connect

Pagina 193 - RTL8019AS

mikroC provides a Sound Library which allows you to use sound signalization inyour applications. You need a simple piezo speaker (or other hardware) o

Pagina 194 - Flash Memory Library

The example is a simple demonstration of how to use sound library for playingtones on a piezo speaker. The code can be used with any MCU that has PORT

Pagina 195

SPI module is available with a number of PIC MCU models. mikroC provides alibrary for initializing Slave mode and comfortable work with Master mode. P

Pagina 196 - I2C Library

MikroElektronika: Development tools - Books - Compilers267pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 197 - I2C_Is_Idle

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...268MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 198 - I2C_Stop

The code demonstrates how to use SPI library functions. Assumed HW configura-tion is: max7219 (chip select pin) connected to RC1, and SDO, SDI, SCK pi

Pagina 199

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...270MikroElektronika: Development tools - Books - CompilerspageHW C

Pagina 200 - HW Connection

USART hardware module is available with a number of PICmicros. mikroCUSART Library provides comfortable work with the Asynchronous (full duplex)mode.Y

Pagina 201 - Keypad Library

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...20MikroElektronika: Development tools - Books - Compilerspage

Pagina 202 - Keypad_Released

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...272MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 203

The example demonstrates simple data exchange via USART. When PIC MCUreceives data, it immediately sends the same data back. If PIC is connected to th

Pagina 204

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...274MikroElektronika: Development tools - Books - CompilerspageSUB-

Pagina 205 - LCD Library (4-bit interface)

Universal Serial Bus (USB) provides a serial bus standard for connecting a widevariety of devices, including computers, cell phones, game consoles, PD

Pagina 206 - Lcd_Out_Cp

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...276MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 207 - Lcd_Chr_Cp

MikroElektronika: Development tools - Books - Compilers277pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Libr

Pagina 208 - LCD Commands

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...278MikroElektronika: Development tools - Books - Compilerspage// T

Pagina 209

MikroElektronika: Development tools - Books - Compilers279pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...HW C

Pagina 210

Util library contains miscellaneous routines useful for project development.mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simpl

Pagina 211 - Lcd8_Config

mikroC provides a set of standard ANSI C library functions for testing and map-ping characters.Note: Not all of the standard functions have been inclu

Pagina 212 - Lcd8_Out_Cp

CHAPTERMikroElektronika: Development tools - Books - Compilers2BuildingApplicationsCreating applications in mikroC is easy and intuitive. Projec

Pagina 213 - Lcd8_Cmd

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...282MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 214

MikroElektronika: Development tools - Books - Compilers283pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 215

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...284MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 216 - GLCD Library

mikroC provides a set of standard ANSI C library functions for floating pointmath handling.Note: Functions have been implemented according to the ANSI

Pagina 217 - Glcd_Set_Side

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...286MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 218 - Glcd_Read_Data

MikroElektronika: Development tools - Books - Compilers287pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 219 - Glcd_Dot

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...288MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 220 - Glcd_H_Line

MikroElektronika: Development tools - Books - Compilers289pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 221 - Glcd_Box

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...290MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 222 - Glcd_Set_Font

mikroC provides a set of standard ANSI C library functions of general utility.Note: Not all of the standard functions have been included. Functions ha

Pagina 223 - Glcd_Write_Char

MikroElektronika: Development tools - Books - CompilersTable of ContentsCHAPTER 1 mikroC IDECHAPTER 2 Building ApplicationsCHAPTER 3 mikroC Refe

Pagina 224 - Glcd_Image

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...22MikroElektronika: Development tools - Books - Compilerspagemikro

Pagina 225

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...292MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 226

MikroElektronika: Development tools - Books - Compilers293pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 227 - 11 1 1 1

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...294MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 228 - Man_Receive

mikroC provides a set of standard ANSI C library functions useful for manipulat-ing strings and arrays of char.Note: Not all of the standard functions

Pagina 229 - Man_Send

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...296MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 230

MikroElektronika: Development tools - Books - Compilers297pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 231

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...298MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 232 - Multi Media Card Library

mikroC Conversions Library provides routines for converting numerals to strings,and routines for BCD/decimal conversions.You can get text representati

Pagina 233 - Mmc_Write_Sector

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...300MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 234 - Mmc_Read_Csd

MikroElektronika: Development tools - Books - Compilers301pagemikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...Prot

Pagina 235 - Mmc_Fat_Assign

Source files containing C code should have the extension .c. List of source filesrelevant for the application is stored in project file with extension

Pagina 236 - Mmc_Fat_Append

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...302MikroElektronika: Development tools - Books - CompilerspageProt

Pagina 237 - Mmc_Set_File_Date

mikroC implements fundamental trigonometry functions. These functions areimplemented as lookup tables, and return the result as integer, multiplied by

Pagina 238

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...304MikroElektronika: Development tools - Books - CompilerspageIf y

Pagina 239

Paths for Header Files (.h)Header files are included by means of preprocessor directive #include. If youplace an explicit path to the header file in p

Pagina 240 - MC33269-3.3

Opening an Existing FileSelect File > Open from drop-down menu, or press CTRL+O, or click the OpenFile icon. The Select Input File dialog opens. In

Pagina 241 - OneWire Library

When you have created the project and written the source code, you will want tocompile it. Select Project > Build from drop-down menu, or click Bui

Pagina 242 - Ow_Write

Error Messages- Specifier needed- Invalid declarator- Expected '(' or identifier- Integer const expected- Array dimension must be greater th

Pagina 243

- Inconsistent storage class- Inconsistent type- %s tag redefined- Illegal typecast- %s is not a valid identifier- Invalid statement- Constant express

Pagina 244

CHAPTERMikroElektronika: Development tools - Books - Compilers3mikroC LanguageReferenceC offers unmatched power and flexibility in programming m

Pagina 245 - PS/2 Library

In order to get the most from your mikroC compiler, you should be familiar withcertain aspects of PIC MCU. This knowledge is not essential, but it can

Pagina 246 - Ps2_Key_Read

PIC16 SpecificsBreaking Through PagesIn applications targeted at PIC16, no single routine should exceed one page (2,000instructions). If routine does

Pagina 247

CHAPTER 1: mikroC IDE 1Quick Overview 1Code Editor 3Code Explorer 6Debugger 7Error Window 11Statistics 12Integrated Tools 15Keyboard Shortcuts 19C

Pagina 248 - PWM Library

ANSI Standard IssuesDivergence from the ANSI C StandardmikroC diverges from the ANSI C standard in few areas. Some of these modifica-tions are improve

Pagina 249 - Pwm_Stop

Predefined Globals and ConstantsTo facilitate PIC programming, mikroC implements a number of predefined glob-als and constants.All PIC SFR registers a

Pagina 250

InterruptsInterrupts can be easily handled by means of reserved word interrupt. mikroCimplictly declares function interrupt which cannot be redeclared

Pagina 251 - RS-485 Library

Linker DirectivesmikroC uses internal algorithm to distribute objects within memory. If you need tohave variable or routine at specific predefined add

Pagina 252 - RS485Master_Receive

These topics provide a formal definition of the mikroC lexical elements. Theydescribe the different categories of word-like units (tokens) recognized

Pagina 253 - RS485Slave_Init

CommentsComments are pieces of text used to annotate a program, and are technicallyanother form of whitespace. Comments are for the programmer’s use o

Pagina 254 - RS485Slave_Send

Token is the smallest element of a C program that is meaningful to the compiler.The parser separates tokens from the input stream by creating the long

Pagina 255

Constants or literals are tokens representing fixed numeric or character values.mikroC supports:- integer constants,- floating point constants,- chara

Pagina 256 - RS485 communication line

Otherwise:If the constant has a U or u suffix, its data type will be the first of the followingthat can accommodate its value: unsigned short, unsigne

Pagina 257 - Secure Digital Library

Binary ConstantsAll constants starting with 0b (or 0B) are taken to be binary. In the absence of anyoverriding suffixes, the data type of an binary co

Pagina 258 - Sd_Write_Sector

Keywords 46Identifiers 47Punctuators 48Objects and Lvalues 52Scope and Visibility 54Name Spaces 56Duration 57Types 59Fundamental Types 60Arithmetic Ty

Pagina 259 - Sd_Read_Csd

Character ConstantsA character constant is one or more characters enclosed in single quotes, such as'A', '+', or '\n'. I

Pagina 260

The following table shows the available escape sequences in mikroC:MikroElektronika: Development tools - Books - Compilers43pagemikroC- C Compil

Pagina 261

String ConstantsString constants, also known as string literals, are a special type of constantswhich store fixed sequences of characters. A string li

Pagina 262 - Software I2C Library

Enumeration ConstantsEnumeration constants are identifiers defined in enum type declarations. The iden-tifiers are usually chosen as mnemonics to assi

Pagina 263 - Soft_I2C_Read

Keywords are words reserved for special purposes and must not be used as normalidentifier names.Beside standard C keywords, all relevant SFR are defin

Pagina 264 - Soft_I2C_Stop

Identifiers are arbitrary names of any length given to functions, variables, symbol-ic constants, user-defined data types, and labels. All these progr

Pagina 265

The mikroC punctuators (also known as separators) include brackets, parentheses,braces, comma, semicolon, colon, asterisk, equal sign, and pound sign.

Pagina 266 - Software SPI Library

BracesBraces { } indicate the start and end of a compound statement:if (d == z) {++x;func();}The closing brace serves as a terminator for the compound

Pagina 267 - Soft_Spi_Write

SemicolonThe semicolon (;) is a statement terminator. Any legal C expression (including theempty expression) followed by a semicolon is interpreted as

Pagina 268

Equal SignThe equal sign (=) separates variable declarations from initialization lists:int test[5] = {1, 2, 3, 4, 5};int x = 5;The equal sign is also

Pagina 269 - Software UART Library

Expressions 113Statements 115Labeled Statements 115Expression Statements 116Selection Statements 116Iteration Statements 119Jump Statements 122Compoun

Pagina 270 - Soft_Uart_Write

ObjectsAn object is a specific region of memory that can hold a fixed or variable value(or set of values). To prevent confusion, this use of the word

Pagina 271

LvaluesAn lvalue is an object locator: an expression that designates an object. An exampleof an lvalue expression is *P, where P is any expression eva

Pagina 272 - Sound Library

ScopeThe scope of identifier is the part of the program in which the identifier can beused to access its object. There are different categories of sco

Pagina 273

VisibilityThe visibility of an identifier is that region of the program source code from whichlegal access can be made to the identifier’s associated

Pagina 274 - SPI Library

Name space is the scope within which an identifier must be unique. C uses fourdistinct categories of identifiers:Goto label namesThese must be unique

Pagina 275 - Spi_Init_Advanced

Duration, closely related to storage class, defines the period during which thedeclared identifiers have real, physical objects allocated in memory. W

Pagina 276 - Spi_Write

Here is an example of two objects with local scope, but with different duration:void f() {/* local duration var; init a upon every call to f */int a =

Pagina 277

C is strictly typed language, which means that every object, function, and expres-sion need to have a strictly defined type, known in the time of comp

Pagina 278 - 8. 8. 8. 8. 8. 8. 8. 8

Arithmetic TypesThe arithmetic type specifiers are built from the following keywords: void, char,int, float, and double, together with prefixes short,

Pagina 279 - USART Library

Below is the overview of arithmetic types:MikroElektronika: Development tools - Books - Compilers61pagemikroC- C Compiler for Microchip PIC micr

Pagina 280 - Usart_Read

SPI Library 266USART Library 271USB HID Library 275Util Library 280ANSI C Ctype Library 281ANSI C Math Library 285ANSI C Stdlib Library 291ANSI C Stri

Pagina 281 - Usart_Write

EnumerationsAn enumeration data type is used for representing an abstract, discreet set of val-ues with appropriate symbolic names.Enumeration Declara

Pagina 282

The order of constants can be explicitly re-arranged. For example:enum colors { black,// value 0red,// value 1green,// value 2blue=6,// value 6violet,

Pagina 283 - USB HID Library

Void Typevoid is a special type indicating the absence of any value. There are no objects ofvoid; instead, void is used for deriving more complex type

Pagina 284 - Hid_Disable

The derived types are also known as structured types. These types are used as ele-ments in creating more complex user-defined types.ArraysArray is the

Pagina 285

Array InitializationArray can be initialized in declaration by assigning it a comma-delimited sequenceof values within braces. When initializing an ar

Pagina 286

Multi-dimensional ArraysAn array is one-dimensional if it is of scalar type. One-dimensional arrays aresometimes referred to as vectors.Multidimension

Pagina 287 - PIC18F4550

PointersPointers are special objects for holding (or “pointing to”) memory addresses. In C,address of an object in memory can be obtained by means of

Pagina 288 - Util Library

Note: You must initialize pointers before using them! Our previously declaredpointer *p is not initialized (i.e. assigned a value), so it cannot be us

Pagina 289 - ANSI C Ctype Library

Pointer ArithmeticPointer arithmetic in C is limited to:- assigning one pointer to another,- comparing two pointers,- comparing pointer to zero (NULL)

Pagina 290

According to these guidelines, we can write:pa = &a[4];// pa points to a[4]x = *(pa + 3);// x = a[7]y = *pa + 3;// y = a[4] + 3Also, you need to b

Pagina 291

mikroC- C Compiler for Microchip PIC microcontrollersmikroCmaking it simple...viiiMikroElektronika: Development tools - Books - Compilerspage

Pagina 292

You can also compare pointers to zero value – this tests if pointer actually pointsto anything. All pointers can be successfully tested for equality o

Pagina 293 - ANSI C Math Library

This allows you to write loops which access the array elements in a sequence bymeans of incrementing pointer — in the last iteration you will have a p

Pagina 294

StructuresA structure is a derived type usually representing a user-defined collection ofnamed members (or components). The members can be of any type

Pagina 295

Note that you can omit structure tag, but then you cannot declare additionalobjects of this type elsewhere. For more information, see the “UntaggedStr

Pagina 296

Structure AssignmentVariables of same structured type may be assigned one to another by means ofsimple assignment operator (=). This will copy the ent

Pagina 297

Structure Member AccessStructure and union members are accessed using the following two selection oper-ators:. (period)-> (right arrow)The operator

Pagina 298

Accessing Nested StructuresIf structure B contains a field whose type is structure A, the members of A can beaccessed by two applications of the membe

Pagina 299 - ANSI C Stdlib Library

UnionsUnion types are derived types sharing many of the syntactic and functional fea-tures of structure types. The key difference is that a union allo

Pagina 300

Referring to declarations from the previous example:mu.d = 4.016;Lcd_Out_Cp(FloatToStr(mu.d));// OK: displays mu.d = 4.016Lcd_Out_Cp(IntToStr(mu.i));/

Pagina 301

Here, tagis an optional name of the structure; bitfield-declarator-listisa list of bit fields. Each component identifer requires a colon and its width

Pagina 302

CHAPTERMikroElektronika: Development tools - Books - Compilers1mikroC IDEmikroC is a powerful, feature rich development tool for PICmicros. It i

Pagina 303 - ANSI C String Library

C is strictly typed language, with each operator, statement and function demandingappropriately typed operands/arguments. However, we often have to us

Pagina 304

Arithmetic ConversionsWhen you use an arithmetic expression, such as a+b, where a and b are of differ-ent arithmetic types, mikroC performs implicit t

Pagina 305

The result of the expression is the same type as that of the two operands.Here are several examples of implicit conversion:2+3.1// = 2. + 3.1 = 5.15/4

Pagina 306

Introduction to DeclarationsDeclaration introduces one or several names to a program – it informs the compil-er what the name represents, what is its

Pagina 307 - Conversions Library

Let’s have an example:/* Here is a nondefining declaration of function max; *//* it merely informs compiler that max is a function */int max();/* Here

Pagina 308 - IntToStr

LinkageAn executable program is usually created by compiling several independent trans-lation units, then linking the resulting object files with pree

Pagina 309 - FloatToStr

External Linkage Rule:1. names having file scope, that do not comply to any of previously stated internal linkage rules, have external linkage.The sto

Pagina 310 - Bcd2Dec16

Storage ClassesAssociating identifiers with objects requires each identifier to have at least twoattributes: storage class and type (sometimes referre

Pagina 311 - Trigonometry Library

StaticGlobal name declared with static specifier has internal linkage, meaning that itis local for a given file. See Linkage for more information.Loca

Pagina 312

Type QualifiersType qualifiers const and volatile are optional in declarations and do not actu-ally affect the type of declared object.Qualifier const

Comentarios a estos manuales

Sin comentarios