Abl-electronic PIC Microcontrollers PIC16 Uživatelský manuál Strana 1

Procházejte online nebo si stáhněte Uživatelský manuál pro Počítače Abl-electronic PIC Microcontrollers PIC16. ABL electronic PIC Microcontrollers PIC16 User Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 312
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 0
1 2 3 4 5 6 ... 311 312

Shrnutí obsahu

Strany 1 - Making it simple

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

Strany 2 - Reader’s note

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 7

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

Strany 8

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

Strany 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

Strany 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

Strany 11 - CODE EDITOR

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

Strany 12

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

Strany 13 - Uncomment Icon

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

Strany 14 - CODE EXPLORER

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

Strany 15 - DEBUGGER

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

Strany 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

Strany 17

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

Strany 18

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

Strany 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

Strany 20 - STATISTICS

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

Strany 21

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

Strany 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

Strany 23 - INTEGRATED TOOLS

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

Strany 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

Strany 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

Strany 26 - KEYBOARD SHORTCUTS

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

Strany 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

Strany 28

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

Strany 29 - Applications

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

Strany 30 - PROJECTS

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

Strany 31 - SOURCE FILES

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

Strany 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

Strany 33 - Close File

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

Strany 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

Strany 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

Strany 36 - Compiler Warning Messages

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

Strany 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

Strany 38 - PIC SPECIFICS

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

Strany 39 - PIC16 Specifics

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

Strany 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

Strany 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

Strany 42 - Interrupts

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

Strany 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

Strany 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

Strany 45 - Comments

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

Strany 46

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

Strany 47 - CONSTANTS

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

Strany 48

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

Strany 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

Strany 50 - Character Constants

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

Strany 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

Strany 52 - String Constants

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

Strany 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

Strany 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

Strany 55 - IDENTIFIERS

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

Strany 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

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

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

Strany 58 - Semicolon

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

Strany 59 - Equal Sign

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

Strany 60 - OBJECTS AND LVALUES

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

Strany 61

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

Strany 62 - SCOPE AND VISIBILITY

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

Strany 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

Strany 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

Strany 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

Strany 66

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

Strany 67 - Type Categories

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

Strany 68 - FUNDAMENTAL TYPES

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

Strany 69

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

Strany 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

Strany 71

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

Strany 72 - Void Type

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

Strany 73 - DERIVED TYPES

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

Strany 74

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

Strany 75

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

Strany 76 - Pointers

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

Strany 77 - /* is same as: */

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

Strany 78 - Pointer Arithmetic

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

Strany 79

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

Strany 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

Strany 81

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

Strany 82 - Structures

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

Strany 83 - // incomplete

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

Strany 84

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

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

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

Strany 86

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

Strany 87

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

Strany 88 - Bit Fields

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

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

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

Strany 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

Strany 91

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

Strany 92

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

Strany 93 - DECLARATIONS

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

Strany 94

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

Strany 95

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

Strany 96 - // Add member declarators

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

Strany 97 - Storage Classes

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

Strany 98

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

Strany 99 - Type Qualifiers

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

Strany 100 - Typedef Specifier

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

Strany 101 - // just a test

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

Strany 102 - Initialization

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

Strany 103 - FUNCTIONS

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

Strany 104 - Function Prototypes

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

Strany 105 - Function Definition

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

Strany 106 - Argument Conversions

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

Strany 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

Strany 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

Strany 109

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

Strany 110 - Arithmetic Operators

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

Strany 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

Strany 112 - Relational Operators

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

Strany 113 - Bitwise Operators

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

Strany 114

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

Strany 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

Strany 116 - /* equals 0 */

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

Strany 117 - Conditional Operator ? :

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

Strany 118 - Assignment Operators

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

Strany 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

Strany 120 - Sizeof Operator

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

Strany 121 - EXPRESSIONS

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

Strany 122

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

Strany 123 - STATEMENTS

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

Strany 124 - Selection Statements

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

Strany 125

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

Strany 126

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

Strany 127 - Iteration Statements

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

Strany 128

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

Strany 129 - ;) for a loop body

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

Strany 130 - Jump Statements

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

Strany 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

Strany 132 - Compound Statements (Blocks)

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

Strany 133 - PREPROCESSOR

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

Strany 134

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

Strany 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-

Strany 136 - Macros with Parameters

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

Strany 137 - Undefining Macros

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

Strany 138 - File Inclusion

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

Strany 139 - Preprocessor Operators

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

Strany 140 - Conditional Compilation

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

Strany 141

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

Strany 142

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

Strany 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

Strany 144 - BUILT-IN ROUTINES

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

Strany 145 - Vdelay_ms

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

Strany 146 - LIBRARY ROUTINES

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

Strany 147 - ADC Library

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

Strany 148 - Hardware Connection

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

Strany 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

Strany 150 - CANGetOperationMode

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

Strany 151 - CANInitialize

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

Strany 152 - CANSetBaudRate

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

Strany 153 - CANSetFilter

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

Strany 154 - CANWrite

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

Strany 155 - CAN Constants

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

Strany 156

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

Strany 157

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

Strany 158

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

Strany 159

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

Strany 160

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

Strany 161 - CANSPI Library

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

Strany 162 - CANSPIGetOperationMode

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

Strany 163 - CANSPIInitialize

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

Strany 164 - CANSPISetBaudRate

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

Strany 165 - CANSPISetFilter

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

Strany 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

Strany 167

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

Strany 168

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

Strany 169

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

Strany 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

Strany 171 - Cf_Detect

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

Strany 172 - Cf_Disable

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

Strany 173 - Cf_Read_Word

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

Strany 174 - Cf_Find_File

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

Strany 175 - Cf_File_Write_Init

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

Strany 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

Strany 177

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

Strany 178

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

Strany 179 - PIC16F877A

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

Strany 180 - EEPROM Library

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

Strany 181 - Eeprom_Read

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

Strany 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

Strany 183 - Eth_Set_Ip_Address

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

Strany 184 - Eth_Set_Inport

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

Strany 185 - Eth_Get_Ip_Hdr_Len

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

Strany 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

Strany 187 - Eth_Arp_Response

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

Strany 188 - Eth_Get_Udp_Source_Port

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

Strany 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

Strany 190 - Eth_Send_Udp

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

Strany 191 - Eth_Get_Tcp_Hdr_Offset

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 196 - I2C Library

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

Strany 197 - I2C_Is_Idle

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

Strany 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

Strany 199

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

Strany 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

Strany 201 - Keypad Library

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

Strany 202 - Keypad_Released

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

Strany 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

Strany 204

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

Strany 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

Strany 206 - Lcd_Out_Cp

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

Strany 207 - Lcd_Chr_Cp

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

Strany 208 - LCD Commands

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

Strany 209

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

Strany 210

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

Strany 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

Strany 212 - Lcd8_Out_Cp

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

Strany 213 - Lcd8_Cmd

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

Strany 214

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

Strany 215

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

Strany 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

Strany 217 - Glcd_Set_Side

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

Strany 218 - Glcd_Read_Data

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

Strany 219 - Glcd_Dot

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

Strany 220 - Glcd_H_Line

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

Strany 221 - Glcd_Box

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

Strany 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

Strany 223 - Glcd_Write_Char

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

Strany 224 - Glcd_Image

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

Strany 225

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

Strany 226

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

Strany 227 - 11 1 1 1

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

Strany 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

Strany 229 - Man_Send

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

Strany 230

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

Strany 231

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

Strany 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

Strany 233 - Mmc_Write_Sector

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

Strany 234 - Mmc_Read_Csd

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

Strany 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

Strany 236 - Mmc_Fat_Append

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

Strany 237 - Mmc_Set_File_Date

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

Strany 238

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

Strany 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

Strany 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

Strany 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

Strany 242 - Ow_Write

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

Strany 243

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

Strany 244

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

Strany 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

Strany 246 - Ps2_Key_Read

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

Strany 247

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

Strany 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

Strany 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

Strany 250

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

Strany 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

Strany 252 - RS485Master_Receive

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

Strany 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

Strany 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

Strany 255

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

Strany 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

Strany 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

Strany 258 - Sd_Write_Sector

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

Strany 259 - Sd_Read_Csd

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

Strany 260

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

Strany 261

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

Strany 262 - Software I2C Library

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

Strany 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

Strany 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

Strany 265

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

Strany 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

Strany 267 - Soft_Spi_Write

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

Strany 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

Strany 269 - Software UART Library

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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 =

Strany 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

Strany 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,

Strany 279 - USART Library

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

Strany 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

Strany 281 - Usart_Write

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

Strany 282

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

Strany 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

Strany 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

Strany 285

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

Strany 286

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

Strany 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

Strany 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

Strany 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)

Strany 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

Strany 291

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

Strany 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

Strany 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

Strany 294

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

Strany 295

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

Strany 296

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

Strany 297

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

Strany 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

Strany 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

Strany 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));/

Strany 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

Strany 302

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

Strany 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

Strany 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

Strany 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

Strany 306

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

Strany 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

Strany 308 - IntToStr

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

Strany 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

Strany 310 - Bcd2Dec16

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

Strany 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

Strany 312

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

Komentáře k této Příručce

Žádné komentáře