Abl-electronic PIC Microcontrollers PIC16 Instrukcja Użytkownika Strona 1

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Komputery Abl-electronic PIC Microcontrollers PIC16. ABL electronic PIC Microcontrollers PIC16 User Manual Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 312
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 0
1 2 3 4 5 6 ... 311 312

Podsumowanie treści

Strona 1 - Making it simple

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

Strona 2 - Reader’s note

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 7

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

Strona 8

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

Strona 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

Strona 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

Strona 11 - CODE EDITOR

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

Strona 12

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

Strona 13 - Uncomment Icon

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

Strona 14 - CODE EXPLORER

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

Strona 15 - DEBUGGER

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

Strona 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

Strona 17

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

Strona 18

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

Strona 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

Strona 20 - STATISTICS

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

Strona 21

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

Strona 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

Strona 23 - INTEGRATED TOOLS

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

Strona 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

Strona 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

Strona 26 - KEYBOARD SHORTCUTS

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

Strona 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

Strona 28

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

Strona 29 - Applications

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

Strona 30 - PROJECTS

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

Strona 31 - SOURCE FILES

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

Strona 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

Strona 33 - Close File

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

Strona 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

Strona 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

Strona 36 - Compiler Warning Messages

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

Strona 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

Strona 38 - PIC SPECIFICS

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

Strona 39 - PIC16 Specifics

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

Strona 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

Strona 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

Strona 42 - Interrupts

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

Strona 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

Strona 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

Strona 45 - Comments

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

Strona 46

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

Strona 47 - CONSTANTS

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

Strona 48

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

Strona 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

Strona 50 - Character Constants

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

Strona 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

Strona 52 - String Constants

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

Strona 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

Strona 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

Strona 55 - IDENTIFIERS

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

Strona 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

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

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

Strona 58 - Semicolon

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

Strona 59 - Equal Sign

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

Strona 60 - OBJECTS AND LVALUES

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

Strona 61

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

Strona 62 - SCOPE AND VISIBILITY

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

Strona 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

Strona 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

Strona 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

Strona 66

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

Strona 67 - Type Categories

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

Strona 68 - FUNDAMENTAL TYPES

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

Strona 69

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

Strona 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

Strona 71

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

Strona 72 - Void Type

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

Strona 73 - DERIVED TYPES

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

Strona 74

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

Strona 75

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

Strona 76 - Pointers

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

Strona 77 - /* is same as: */

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

Strona 78 - Pointer Arithmetic

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

Strona 79

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

Strona 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

Strona 81

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

Strona 82 - Structures

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

Strona 83 - // incomplete

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

Strona 84

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

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

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

Strona 86

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

Strona 87

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

Strona 88 - Bit Fields

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

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

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

Strona 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

Strona 91

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

Strona 92

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

Strona 93 - DECLARATIONS

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

Strona 94

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

Strona 95

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

Strona 96 - // Add member declarators

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

Strona 97 - Storage Classes

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

Strona 98

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

Strona 99 - Type Qualifiers

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

Strona 100 - Typedef Specifier

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

Strona 101 - // just a test

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

Strona 102 - Initialization

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

Strona 103 - FUNCTIONS

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

Strona 104 - Function Prototypes

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

Strona 105 - Function Definition

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

Strona 106 - Argument Conversions

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

Strona 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

Strona 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

Strona 109

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

Strona 110 - Arithmetic Operators

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

Strona 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

Strona 112 - Relational Operators

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

Strona 113 - Bitwise Operators

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

Strona 114

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

Strona 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

Strona 116 - /* equals 0 */

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

Strona 117 - Conditional Operator ? :

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

Strona 118 - Assignment Operators

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

Strona 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

Strona 120 - Sizeof Operator

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

Strona 121 - EXPRESSIONS

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

Strona 122

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

Strona 123 - STATEMENTS

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

Strona 124 - Selection Statements

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

Strona 125

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

Strona 126

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

Strona 127 - Iteration Statements

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

Strona 128

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

Strona 129 - ;) for a loop body

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

Strona 130 - Jump Statements

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

Strona 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

Strona 132 - Compound Statements (Blocks)

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

Strona 133 - PREPROCESSOR

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

Strona 134

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

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

Strona 136 - Macros with Parameters

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

Strona 137 - Undefining Macros

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

Strona 138 - File Inclusion

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

Strona 139 - Preprocessor Operators

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

Strona 140 - Conditional Compilation

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

Strona 141

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

Strona 142

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

Strona 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

Strona 144 - BUILT-IN ROUTINES

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

Strona 145 - Vdelay_ms

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

Strona 146 - LIBRARY ROUTINES

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

Strona 147 - ADC Library

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

Strona 148 - Hardware Connection

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

Strona 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

Strona 150 - CANGetOperationMode

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

Strona 151 - CANInitialize

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

Strona 152 - CANSetBaudRate

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

Strona 153 - CANSetFilter

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

Strona 154 - CANWrite

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

Strona 155 - CAN Constants

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

Strona 156

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

Strona 157

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

Strona 158

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

Strona 159

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

Strona 160

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

Strona 161 - CANSPI Library

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

Strona 162 - CANSPIGetOperationMode

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

Strona 163 - CANSPIInitialize

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

Strona 164 - CANSPISetBaudRate

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

Strona 165 - CANSPISetFilter

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

Strona 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

Strona 167

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

Strona 168

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

Strona 169

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

Strona 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

Strona 171 - Cf_Detect

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

Strona 172 - Cf_Disable

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

Strona 173 - Cf_Read_Word

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

Strona 174 - Cf_Find_File

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

Strona 175 - Cf_File_Write_Init

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

Strona 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

Strona 177

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

Strona 178

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

Strona 179 - PIC16F877A

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

Strona 180 - EEPROM Library

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

Strona 181 - Eeprom_Read

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

Strona 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

Strona 183 - Eth_Set_Ip_Address

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

Strona 184 - Eth_Set_Inport

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

Strona 185 - Eth_Get_Ip_Hdr_Len

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

Strona 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

Strona 187 - Eth_Arp_Response

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

Strona 188 - Eth_Get_Udp_Source_Port

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

Strona 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

Strona 190 - Eth_Send_Udp

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

Strona 191 - Eth_Get_Tcp_Hdr_Offset

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 196 - I2C Library

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

Strona 197 - I2C_Is_Idle

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

Strona 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

Strona 199

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

Strona 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

Strona 201 - Keypad Library

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

Strona 202 - Keypad_Released

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

Strona 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

Strona 204

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

Strona 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

Strona 206 - Lcd_Out_Cp

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

Strona 207 - Lcd_Chr_Cp

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

Strona 208 - LCD Commands

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

Strona 209

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

Strona 210

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

Strona 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

Strona 212 - Lcd8_Out_Cp

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

Strona 213 - Lcd8_Cmd

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

Strona 214

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

Strona 215

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

Strona 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

Strona 217 - Glcd_Set_Side

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

Strona 218 - Glcd_Read_Data

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

Strona 219 - Glcd_Dot

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

Strona 220 - Glcd_H_Line

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

Strona 221 - Glcd_Box

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

Strona 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

Strona 223 - Glcd_Write_Char

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

Strona 224 - Glcd_Image

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

Strona 225

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

Strona 226

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

Strona 227 - 11 1 1 1

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

Strona 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

Strona 229 - Man_Send

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

Strona 230

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

Strona 231

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

Strona 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

Strona 233 - Mmc_Write_Sector

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

Strona 234 - Mmc_Read_Csd

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

Strona 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

Strona 236 - Mmc_Fat_Append

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

Strona 237 - Mmc_Set_File_Date

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

Strona 238

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

Strona 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

Strona 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

Strona 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

Strona 242 - Ow_Write

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

Strona 243

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

Strona 244

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

Strona 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

Strona 246 - Ps2_Key_Read

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

Strona 247

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

Strona 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

Strona 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

Strona 250

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

Strona 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

Strona 252 - RS485Master_Receive

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

Strona 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

Strona 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

Strona 255

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

Strona 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

Strona 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

Strona 258 - Sd_Write_Sector

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

Strona 259 - Sd_Read_Csd

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

Strona 260

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

Strona 261

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

Strona 262 - Software I2C Library

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

Strona 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

Strona 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

Strona 265

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

Strona 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

Strona 267 - Soft_Spi_Write

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

Strona 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

Strona 269 - Software UART Library

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

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

Strona 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

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

Strona 279 - USART Library

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

Strona 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

Strona 281 - Usart_Write

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

Strona 282

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

Strona 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

Strona 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

Strona 285

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

Strona 286

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

Strona 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

Strona 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

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

Strona 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

Strona 291

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

Strona 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

Strona 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

Strona 294

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

Strona 295

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

Strona 296

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

Strona 297

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

Strona 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

Strona 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

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

Strona 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

Strona 302

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

Strona 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

Strona 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

Strona 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

Strona 306

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

Strona 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

Strona 308 - IntToStr

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

Strona 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

Strona 310 - Bcd2Dec16

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

Strona 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

Strona 312

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

Komentarze do niniejszej Instrukcji

Brak uwag