MikroElektronika PIC Microcontrollers PIC16 Spezifikationen

Stöbern Sie online oder laden Sie Spezifikationen nach PC / Workstation Barebones MikroElektronika PIC Microcontrollers PIC16 herunter. mikroElektronika PIC Microcontrollers PIC16 Specifications Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 186
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 0
PIC book
Previous page Table of contents Chapter overview Next page
PIC microcontrollers for beginners,too!
Author: Nebojsa Matic
Paperback - 252 pages (May 15, 2000)
Dimensions (in inches): 0.62 x 9.13 x 7.28
PIC microcontrollers; low-cost computers-in-a-chip; allows
electronics designers and hobbyists add intelligence and
functions that mimic big computers for almost any electronic
product or project.
The purpose of this book is not to make a microcontroller expert
out of you, but to make you equal to those who had someone to
go to for their answers.
In this book you can find:
Practical connection samples for
Relays, Optocouplers, LCD's, Keys, Digits, A to D Converters, Serial communication etc.
Introduction to microcontrollers
Learn what they are, how they work, and how they can be helpful in your work.
Assembler language programming
How to write your first program, use of macros, addressing modes....
Instruction Set
Description, sample and purpose for using each instruction........
MPLAB program package
How to install it, how to start the first program, following the program step by step in the simulator....
C o n t e n t s
CHAPTER I INTRODUCTION TO MICROCONTROLLERS
Introduction
History
Microcontrollers versus microprocessors
1.1 Memory unit
1.2 Central processing unit
1.3 Buses
1.4 Input-output unit
1.5 Serial communication
1.6 Timer unit
1.7 Watchdog
http://www.mikroelektronika.co.yu/english/product/books/PICbook/0_Uvod.htm (1 of 5) [4/2/2003 16:17:25]
Seitenansicht 0
1 2 3 4 5 6 ... 185 186

Inhaltsverzeichnis

Seite 1 - C o n t e n t s

PIC bookPrevious page Table of contents Chapter overview Next page PIC microcontrollers for beginners,too! Author: Nebojsa Matic Paperback - 252 page

Seite 2 - PIC book

Chapter 1 - Introduction to Microprocessors1.4 Input-output unit Those locations we've just added are called "ports". There are several

Seite 3

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Macros used in programs Examples given in the following sections of this

Seite 4

Chapter 6 - SamplesIf we use the oscillator (resonator) of 4MHz, for prescaler values 0, 1, and 7 that divide the basic clock of the oscillator, the i

Seite 5 - Send us a comment about a

Chapter 6 - Samples How one such sequence is formed by using dt instruction is shown in the following example: org 0x00goto Main String movwf PCLStrin

Seite 6 - CHAPTER 1

Chapter 6 - Samples Macro PRINT writes out a string of ASCII caracters for 'MikroElektronika' on LCD display.The string takes up one part of

Seite 7

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Samples Light-Emitting Diodes - LEDs LEDs are surely one of the most com

Seite 8 - 1.1 Memory unit

Chapter 6 - Samples Connecting LED diodes to PORTB microcontroller The following example initializes port B as output and sets logic one to each pin o

Seite 9 - 1.3 Bus

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 10 - 1.5 Serial communication

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Keyboard Keyboards are mechanical devices used to execute a break or mak

Seite 11 - 1.7 Watchdog

Chapter 6 - Samples The above macro has several arguments that need to be explained:TESTER macro HiLo, Port, Bit, Delay, Address HiLo can be '0&a

Seite 12

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 13 - 1.9 Program

Chapter 1 - Introduction to Microprocessors As we have separate lines for receiving and sending, it is possible to receive and send data (info.) at th

Seite 14

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page OptocouplerOptocoupler combine a LED and photo-transistor in the same ca

Seite 15 - CHAPTER 2

Chapter 6 - Samples Input line optocoupler example http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_05Poglavlje.htm (2 of 3) [4/2/20

Seite 16 - CISC, RISC

Chapter 6 - SamplesOptocoupler on an output lineAn Optocoupler can be used to separate the output signal of a microcontroller from an output device. T

Seite 17 - Pipelining

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page The Relay The relay is an electromechanical device, which transforms an

Seite 18 - Pin description

Chapter 6 - Samples Connecting the optocoupler and relay to a microcontroller A relay can also be activated via an optocoupler which at the same time

Seite 19

Chapter 6 - Samples http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_06Poglavlje.htm (3 of 4) [4/2/2003 16:18:54]

Seite 20 - RC Oscillator

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comme

Seite 21

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Generating a soundA Piezo diaphragm can be added to an output line of a

Seite 22

Chapter 6 - Samplesduration: sound duration. The higher the number, the longer the sound.Example 1: BEEP 0xFF, 0x02The output of the piezo diaphragm

Seite 23 - 2.2 Reset

Chapter 6 - Samples The following example shows the use of a macro in a program. The program produces two melodies which are obtained by pressing T1 o

Seite 24

Chapter 1 - Introduction to MicroprocessorsOf course, when this happens with a computer, we simply reset it and it will keep working. However, there i

Seite 25 - Arithmetic Logic Unit (ALU)

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 26

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Shift registers There are two types of shift registers: input and output

Seite 27 - STATUS Register

Chapter 6 - Samples How to connect an input shift register to a microcontrollerIn order to simplify the main program, a macro can be used for the inpu

Seite 28 - OPTION register

Chapter 6 - Samples Example of how to use the HC597 macro is given in the following program. Program receives data from a parallel input of the shift

Seite 29

Chapter 6 - Samples Output shift registerOutput shift registers transform serial data into parallel data. On every rising edge of the clock, the shift

Seite 30

Chapter 6 - Samplesregister, thus data is transformed from serial into parallel data. An outline of the 74HC595 shift register connections is shown o

Seite 31 - 2.4 Ports

Chapter 6 - Samples An example of how to use the HC595 macro is given in the following program. Data from variable TX is serially transferred to shift

Seite 32

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 33 - SFR registers

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Seven-Segment Display (multiplexing) The segments in a 7-segment display

Seite 34 - Memory Banks

Chapter 6 - Samples Connecting a microcontroller to 7-segment displays in multiplex modeFile Led.inc contains two macros: LED_Init and LED_Disp2. The

Seite 35 - Direct Addressing

Chapter 1 - Introduction to MicroprocessorsMicrocontroller outline with its basic elements and internal connections For a real application, a microcon

Seite 36 - Indirect Addressing

Chapter 6 - Sampleshttp://www.mikroelektronika.co.yu/english/product/books/PICbook/6_09Poglavlje.htm (3 of 5) [4/2/2003 16:19:03]

Seite 37

Chapter 6 - Samples The following example shows the use of macros in a program. Program displays number '21' in two 7-segment digits. http:/

Seite 38 - INTCON Register

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 39

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page LCD Display More microcontroller devices are using 'smart LCD'

Seite 40

Chapter 6 - SamplesReading data from the LCD is done in the same way, but control line R/W has to be high. When we send a high to the LCD, it will res

Seite 41

Chapter 6 - SamplesLCD's can get stuck, and program will then stay forever in a loop checking the BUSY bit. The other way is to introduce a delay

Seite 42

Chapter 6 - Sampleshttp://www.mikroelektronika.co.yu/english/product/books/PICbook/6_10Poglavlje.htm (4 of 11) [4/2/2003 16:19:08]

Seite 43 - Interrupt initialization

Chapter 6 - Sampleshttp://www.mikroelektronika.co.yu/english/product/books/PICbook/6_10Poglavlje.htm (5 of 11) [4/2/2003 16:19:08]

Seite 44

Chapter 6 - Samples http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_10Poglavlje.htm (6 of 11) [4/2/2003 16:19:08]

Seite 45 - 2.7 Free-run timer TMR0

Chapter 6 - SamplesMacro for LCD support LCDinit macro used to initialize port connected to LCD. LCD is configured to work in four-bit mode.Example: L

Seite 46

Chapter 1 - Introduction to MicroprocessorsThe program adds the contents of two memory locations, and views their sum on port A. The first line of th

Seite 47

Chapter 6 - Samples Macro LCDval_16 converts 16-bit binary number into decimal number from 0 to 65535 and displays it on LCD display. The following va

Seite 48 - OPTION Control Register

Chapter 6 - Sampleshttp://www.mikroelektronika.co.yu/english/product/books/PICbook/6_10Poglavlje.htm (9 of 11) [4/2/2003 16:19:08]

Seite 49

Chapter 6 - Samples The main program is a demonstration of using the LCD display and generate new characters. At the beginning of a program, we need t

Seite 50 - EECON1 Register

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 51 - Writing to EEPROM Memory

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page 12-bit Analog to Digital converter Since everything in the microcontroll

Seite 52

Chapter 6 - Samples Connecting an AD converter with voltage reference to a microcontrollerThe Macro used in this example is LTC86 and is found in LTC1

Seite 53 - CHAPTER 3

Chapter 6 - Samples The LTC86 Macro has three arguments:LTC86 macro Var_LO, Var_HI, VarVar_LO variable is where the result of lower byte conversion is

Seite 54 - Directing a program flow

Chapter 6 - Samplesresult is 0, and for 5V it is 4095. http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_11Poglavlje.htm (4 of 6) [4/2

Seite 55 - Word list

Chapter 6 - Samples http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_11Poglavlje.htm (5 of 6) [4/2/2003 16:19:11]

Seite 56 - Chapter 3 - Instruction Set

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any commen

Seite 57 - CHAPTER 4

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page CHAPTER 2 Microcontroller PIC16F84 IntroductionCISC, R

Seite 58 - Introduction

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page Serial Communication SCI is an abbreviation for Serial Communication Int

Seite 59 - Instructions

Chapter 6 - Samples Connecting a microcontroller to a PC via a MAX232 line interface chip.File RS232.inc contains a group of macros used for serial co

Seite 60 - Directives

Chapter 6 - Sampleshttp://www.mikroelektronika.co.yu/english/product/books/PICbook/6_12Poglavlje.htm (3 of 6) [4/2/2003 16:19:14]

Seite 61

Chapter 6 - Samples Using the macro:RS232init Macro for initializing RB0 pin and line for transmitting data (TX-pin).Example: RS232initSEND S_string S

Seite 62

Chapter 6 - SamplesMain program: http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_12Poglavlje.htm (5 of 6) [4/2/2003 16:19:14]

Seite 63

Chapter 6 - Samples Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For any comm

Seite 64

Appendix A - Instruction SetPrevious page Table of contents Chapter overview Next page Appendix A Instruction Set Introduction Appendix contains all

Seite 65

Appendix A - Instruction Set● A.35 SLEEP A.1 MOVLW Write constant in W register A.2 MOVWF Copy W to f A.3 MOVF Copy f to d http://

Seite 66 - Data Directives

Appendix A - Instruction Set A.4 CLRW Write 0 in W A.5 Write 0 in f http://www.mikroelektronika.co.yu/english/product/books/PICbook/A_Dodatak.ht

Seite 67

Appendix A - Instruction Set A.6 SWAPF Copy the nibbles from f to d crosswise A.7 ADDLW Add W to a constant http://www.mikroelektronika.co.

Seite 68

Chapter 2 - Microcontroller PIC16F84microcontroller. It coordinates the work of other blocks and executes the user program. CISC, RISCIt has already

Seite 69

Appendix A - Instruction Set A.8 ADDWF Add W to f A.9 SUBLW Subtract W from a constant http://www.mikroelektronika.co.yu/english/product/bo

Seite 70

Appendix A - Instruction Set A.10 SUBWF Subtract W from f A.11 ANDLW Logic AND W with constant http://www.mikroelektronika.co.yu/english/pr

Seite 71

Appendix A - Instruction Set A.12 ANDWF Logic AND W with f A.13 IORLW Logic OR W with constant http://www.mikroelektronika.co.yu/english/pr

Seite 72 - CHAPTER 5

Appendix A - Instruction Set A.14 IORWF Logic OR W with f A.15 XORLW Logic exclusive OR W with constant http://www.mikroelektronika.co.yu/e

Seite 73 - Chapter 5 - MPLAB

Appendix A - Instruction Set A.16 XORWF Logic exclusive OR W with f A.17 INCF Increment f http://www.mikroelektronika.co.yu/english/product

Seite 74

Appendix A - Instruction Set A.18 DECF Decrement f http://www.mikroelektronika.co.yu/english/product/books/PICbook/A_Dodatak.htm (10 of 21) [4/2/

Seite 75

Appendix A - Instruction Set A.19 RLF Rotate f to the left through CARRY http://www.mikroelektronika.co.yu/english/product/books/PICbook/A_Dodata

Seite 76

Appendix A - Instruction Set A.20 RRF Rotate f to the right through CARRY http://www.mikroelektronika.co.yu/english/product/books/PICbook/A_Dodat

Seite 77

Appendix A - Instruction Set A.21 COMF Complement f http://www.mikroelektronika.co.yu/english/product/books/PICbook/A_Dodatak.htm (13 of 21) [4/2

Seite 78

Appendix A - Instruction Set A.22 BCF Reset bit b in f A.23 BSF Set bit b in f http://www.mikroelektronika.co.yu/english/product/books/PICb

Seite 79 - Screen prior to installment

Chapter 2 - Microcontroller PIC16F84more precisely 35 instructions . (ex. Intel's and Motorola's microcontrollers have over hundred instruct

Seite 80 - Installment flow

Appendix A - Instruction Set A.24 BTFSC Test bit b in f, skip if it = 0 A.25 BTFSS Test bit b in f, skip if =1 http://www.mikroelektronika.

Seite 81

Appendix A - Instruction Set A.26 INCFSZ Increment f, skip if=0 A.27 DECFSZ Decrement f, skip if = 0 http://www.mikroelektronika.co.yu/engl

Seite 82 - 5.2 MPLAB

Appendix A - Instruction Set A.28 GOTO Jump to address A.29 CALL Call a program http://www.mikroelektronika.co.yu/english/product/books/PIC

Seite 83

Appendix A - Instruction Set A.30 RETURN Return from a subprogram A.31 RETLW Return from a subprogram with constant in W http://www.mikroelektro

Seite 84

Appendix A - Instruction Set A.32 RETFIE Return from interrupt routine A.33 NOP No operation A.34 CLRWDT Initialize watchdog timer ht

Seite 85 - 5.4 Designing a project

Appendix A - Instruction Set A.35 SLEEP Stand by mode Previous page Table of contents Chapter overview Next page http://www.mikroelektronika.c

Seite 86 - Adjusting project elements

Appendix A - Instruction Set© Copyright 1999. mikroElektronika. All Rights Reserved. For any comments contact webmaster. http://www.mikroelektronika.c

Seite 87

Appendix B - Numeric SystemsPrevious page Table of contents Chapter overview Next page Appendix B Numeric Systems Introduction B.1 Decimal numeric s

Seite 88 - Assembler file added

Appendix B - Numeric Systems Operations of addition, subtraction, division, and multiplication in a decimal numeric system are used in a way that is a

Seite 89

Appendix B - Numeric Systems As you can see, converting a binary number into a decimal number is done by calculating the expression on the left side.

Seite 90

Chapter 2 - Microcontroller PIC16F84Instruction cycle consists of cycles Q1, Q2, Q3 and Q4. Cycles of calling and executing instructions are connected

Seite 91 - 5.6 Writing a program

Appendix B - Numeric Systems We can check whether result is correct by transferring these number to decimal numeric system and by performing addition

Seite 92

Appendix B - Numeric Systemswhich proves the accuracy of our action. In order to get a decimal equivalent of a hexadecimal number, we need to multiply

Seite 93 - 5.7 MPSIM Simulator

Appendix B - Numeric SystemsPrevious page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserved. For a

Seite 94

Appendix C - GlossaryPrevious page Table of contents Chapter overview Next page Appendix CGlossary Introduction● Microcontroller ● I/O pin ●

Seite 95 - Toolbar icon description

Appendix C - GlossaryI/O pinExternal microcontroller's connector pin which can be configured as input or output. In most cases I/O pin enables a

Seite 96

Appendix C - GlossaryFile written in the language understood by man and assembler translator. By translating the source file, we get HEX and LIST file

Seite 97

Appendix C - GlossaryProductProduct development is a combination of luck and experience. Short terms, or time-limits for production should be avoided

Seite 98 - CHAPTER 6

Chapter 2 - Microcontroller PIC16F84Pins on PIC16F84 microcontroller have the following meaning:Pin no.1 RA2 Second pin on port A. Has no additional f

Seite 99

PIC book1.8 Analog to digital converter1.9 Program CHAPTER II MICROCONTROLLER PIC16F84 IntroductionCISC, RISCApplicationsClock/instruction cyclePipeli

Seite 100 - Macros WAIT, WAITX

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.1 Clock generator - oscillatorOscillator circuit is u

Seite 101 - Macro PRINT

Chapter 2 - Microcontroller PIC16F84Above diagram shows how RC oscillator is connected with PIC16F84. With value of resistor R being below 2.2k, oscil

Seite 102 - Chapter 6 - Samples

Chapter 2 - Microcontroller PIC16F84 Previous page Table of contents Chapter overview Next page © Copyright 1999. mikroElektronika. All Rights Reserv

Seite 103

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.2 ResetReset is used for putting the microcontroller

Seite 104 - Light-Emitting Diodes - LEDs

Chapter 2 - Microcontroller PIC16F84especially in industrial environment where disturbances and instability of supply are an everyday occurrence. To s

Seite 105

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.3 Central Processing UnitCentral processing unit (CPU

Seite 106

Chapter 2 - Microcontroller PIC16F84In instructions with two operands, ordinarily one operand is in work register (W register), and the other is one o

Seite 107 - Keyboard

Chapter 2 - Microcontroller PIC16F84 STATUS Register bit 0 C (Carry) TransferBit that is affected by operations of addition, subtraction and shifting.

Seite 108

Chapter 2 - Microcontroller PIC16F84C bit is affected by ADDWF, ADDLW, SUBLW, SUBWF instructions.bit 1 DC (Digit Carry) DC TransferBit affected by ope

Seite 109

Chapter 2 - Microcontroller PIC16F84bit 0:2 PS0, PS1, PS2 (Prescaler Rate Select bit) These three bits define prescaler rate select bit. What a presca

Seite 110 - Optocoupler on an input line

PIC book● 4.7 org● 4.8 endConditional instructions● 4.9 if● 4.10 else● 4.11 endif● 4.12 while● 4.13 endw● 4.14 ifdef●

Seite 111

Chapter 2 - Microcontroller PIC16F84© Copyright 1999. mikroElektronika. All Rights Reserved. For any comments contact webmaster. http://www.mikroelekt

Seite 112 - Optocoupler on an output line

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.4 PortsPort refers to a group of pins on a microcontr

Seite 113 - The Relay

Chapter 2 - Microcontroller PIC16F84logical one into logical zero and opposite. Only pins configured as input can cause this interrupt to occur (if an

Seite 114

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.5 Memory organizationPIC16F84 has two separate memory

Seite 115

Chapter 2 - Microcontroller PIC16F84Memory Banks Beside this 'length' division to SFR and GPR registers, memory map is also divided in &apos

Seite 116

Chapter 2 - Microcontroller PIC16F84bsf STATUS, RP0 Instruction BSF sets the bit RP0 (RP0=1) in STATUS register and thus sets up bank1.Usually, groups

Seite 117 - Generating a sound

Chapter 2 - Microcontroller PIC16F84Bsf STATUS, RP0 ;Banklmovlw 0xFF ;w=0xFFmovwf TRISA ;address of TRISA register is taken from

Seite 118

Chapter 2 - Microcontroller PIC16F84An of such example can be sending a set of data via serial communication, working with buffers and indicators (whi

Seite 119

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.6 InterruptsInterrupts are a mechanism of a microcont

Seite 120

Chapter 2 - Microcontroller PIC16F84bit 0 RBIF (RB Port Change Interrupt Flag bit) Bit which informs about changes on pins 4, 5, 6 and 7 of port B.1=a

Seite 121 - Input shift register 74HC597

PIC book● Macros WAIT, WAITX● Macro PRINT6.3 Samples ● Light Emitting Diodes● Keyboard● Optocoupler ❍ Optocouplering the input

Seite 122

Chapter 2 - Microcontroller PIC16F84Generally speaking, each interrupt source has two bits joined to it. One enables interrupts, and the other detects

Seite 123

Chapter 2 - Microcontroller PIC16F84One of the possible cases of errors if saving was not done when going to a subprogram of an interrupt Due to simpl

Seite 124 - Output shift register

Chapter 2 - Microcontroller PIC16F84 The same example can be realized by using macros, thus getting a more legible program. Macros that are already de

Seite 125

Chapter 2 - Microcontroller PIC16F84External interrupt on RB0/INT pin is triggered by rising signal edge (if bit INTEDG=1 in OPTION<6> register)

Seite 126

Chapter 2 - Microcontroller PIC16F84Return from interrupt routine can be accomplished with instructions RETURN, RETLW and RETFIE. It is recommended th

Seite 127

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.7 Free-run timer TMR0Timers are usually most complica

Seite 128

Chapter 2 - Microcontroller PIC16F84by one. This provides us with the ability to measure longer timer periods.After each count up to 255, timer resets

Seite 129

Chapter 2 - Microcontroller PIC16F84now the inductive sensor at a distance of 5mm from the head of a screw. Inductive sensor will generate the falling

Seite 130

Chapter 2 - Microcontroller PIC16F84Prescaler is accorded to timer TMR0, or to watchdog timer trough PSA bit in OPTION register. By clearing PSA bit,

Seite 131

Chapter 2 - Microcontroller PIC16F84bit 7 RBPU (PORTB Pull-up Enable bit) This bit turns internal pull-up resistors on port B on or off. 1='pull-

Seite 132

PIC bookSubject : Name : State : E-mail : Your message: Send us a comment about a book © C o p y r i g h t 2 0 0 1. m i k r o E l e k t r o n

Seite 133 - LCD Display

Chapter 2 - Microcontroller PIC16F84Previous page Table of contents Chapter overview Next page 2.8 EEPROM Data memoryPIC16F84 has 64 bytes of EEPROM m

Seite 134

Chapter 2 - Microcontroller PIC16F840=writing disallowedbit 3 WRERR (Write EEPROM Error Flag ) Error during writing to EEPROMThis bit was set only in

Seite 135

Chapter 2 - Microcontroller PIC16F84It is recommended that WREN be turned off the whole time except when writing data to EEPROM, so that possibility o

Seite 136

Chapter 3 - Instruction SetPrevious page Table of contents Chapter overview Next page CHAPTER 3 Instruction Set IntroductionInstruction set in PIC16

Seite 137

Chapter 3 - Instruction SetArithmetic and logic Of all arithmetic operations, PIC like most microcontrollers supports only subtraction and addition. F

Seite 138

Chapter 3 - Instruction Setinstruction. Instruction Execution Period All instructions are executed in one cycle except for conditional branch instruct

Seite 139 - Macro for LCD support

Chapter 3 - Instruction Set *1 If I/O port is source operand, status on microcontroller pins is read*2 If this instruction is executed on TMR register

Seite 140

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmPrevious page Table of contents Chapter overview Next page CHAPTER 4 As

Seite 141

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmFiles created as a result of program translationMacrosIntroduction The

Seite 142

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmcapable of producing an ASCII file on the computer disc or in specializ

Seite 143

Chapter 1 - Introduction to MicroprocessorsPrevious page Table of contents Chapter overview Next page CHAPTER 1 Introduction to Microcontrollers Int

Seite 144

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmOperandsOperands are the instruction elements for the instruction is be

Seite 145

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm Since this data isn't important for the assembly translator, it i

Seite 146

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmoccurs. For that purpose, one infinite loop is made where the micro is

Seite 147

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmDescription:By using this directive, textual designation changes with p

Seite 148

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm4.8 END End of program Syntax:endDescription:At the end of each pr

Seite 149

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmSyntax:endifDescription:Directive is written at the end of a conditiona

Seite 150 - Serial Communication

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmreached.Example:#define test.ifdef test ;how the test was defined...

Seite 151

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm4.17 ENDC End of constant block definition Syntax:endcDescripti

Seite 152

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm_ _config<term> or_ _config<address>,<term> Descripti

Seite 153

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm Files created as a result of program translation As a result of the pr

Seite 154 - Main program:

Chapter 1 - Introduction to Microprocessorsidea what treasure they had. During that year, there appeared on the market a microprocessor called 4004. T

Seite 155

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htmhttp://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Pogla

Seite 156 - Appendix A

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm At the end of the "list" file there is a table of symbols us

Seite 157 - A.3 MOVF Copy f to d

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page CHAPTER 5 MPLAB Introduction5.1 Installing the MPLAB program package 5.2

Seite 158 - A.5 Write 0 in f

Chapter 5 - MPLAB- Generating and processing a program (Text Editor)- Simulator of the written program used for simulating program function on the mic

Seite 159 - Appendix A - Instruction Set

Chapter 5 - MPLAB Welcome screen at the beginning of MPLAB installment At the very beginning, it is necessary to select those MPLAB components we will

Seite 160 - A.8 ADDWF Add W to f

Chapter 5 - MPLAB Selecting components of MPLAB developing environment As it is assumed you will work in Windows 95 ( or a newer operating system), ev

Seite 161

Chapter 5 - MPLABLike any other program, MPLAB should be installed into some directory. This option could be moved into any directory on any hard disc

Seite 162

Chapter 5 - MPLAB Option for users who are installing a new version over an already installed MPLAB Start menu is a group of program pointers, and is

Seite 163

Chapter 5 - MPLABLocation that will be mentioned from here on, has to do with a part of MPLAB whose explanation we don't need to get into. By sel

Seite 164 - A.17 INCF Increment f

Chapter 5 - MPLAB Selecting a directory for system files After all of the above steps, installment begins by clicking on 'Next'. Screen pri

Seite 165 - A.18 DECF Decrement f

Chapter 1 - Introduction to Microprocessorscomponents for receiving and sending data must be added to it. In short that means that microprocessor is t

Seite 166

Chapter 5 - MPLABwindow in the right corner of the screen. Installment flow After installment have been completed, there are two dialog screens, one

Seite 167

Chapter 5 - MPLAB Last minute information regarding program versions and corrections. By clicking on Finish, installment of MPLAB is finished. Previo

Seite 168 - A.21 COMF Complement f

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page 5.2 MPLAB Following the installment procedure, you will get a screen of th

Seite 169 - A.23 BSF Set bit b in f

Chapter 5 - MPLABOpening a new window for a simulatorOpening a new window for variables whose values we watch (Watch Window)Saving a window with varia

Seite 170

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page 5.3 Choosing the development mode Setting a developing mode is necessary s

Seite 171

http://www.mikroelektronika.co.yu/english/product/books/PICbook/5_04Poglavlje.htmPrevious page Table of contents Chapter overview Next page 5.4 Design

Seite 172

http://www.mikroelektronika.co.yu/english/product/books/PICbook/5_04Poglavlje.htmAdjusting project elements Using a mouse click on "test [.hex]&q

Seite 173

http://www.mikroelektronika.co.yu/english/product/books/PICbook/5_04Poglavlje.htm Defining parameters of MPASM assembler From the picture we see that

Seite 174 - A.33 NOP No operation

http://www.mikroelektronika.co.yu/english/product/books/PICbook/5_04Poglavlje.htmOpening a new project By clicking on OK we go back to the starting wi

Seite 175

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page 5.5 Designing a new assembler file (writing a new program) When "proj

Seite 176

Chapter 1 - Introduction to Microprocessors Registers are therefore memory locations whose role is to help with performing various mathematical operat

Seite 177 - Appendix B

Chapter 5 - MPLAB Naming and saving a new assembler file When we get this window, we need to write 'test.asm' below 'File name:',

Seite 178 - B.2 Binary numeric system

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page 5.6 Writing a program Only after all of the preceding operations have been

Seite 179 - Appendix B - Numeric Systems

Chapter 5 - MPLAB Window with messages following a translation of assembler program We can see from the picture that we get "test.hex" file

Seite 180

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page 5.7 MPSIM Simulator Simulator is part of MPLAB environment which provides

Seite 181 - Conclusion

Chapter 5 - MPLABIf there are variables in the program, it is good to watch them, too. To each variable is assigned one window (Watch Windows) by clic

Seite 182

Chapter 5 - MPLABPrevious page Table of contents Chapter overview Next page 5.8 Toolbar Since MPLAB has more than one component, each of the component

Seite 183 - Appendix C

Chapter 5 - MPLABIcon for saving a project. Saved project will keep all window adjustments and all parameter adjustments. When we read in a program ag

Seite 184 - Appendix C - Glossary

Chapter 5 - MPLAB © Copyright 1999. mikroElektronika. All Rights Reserved. For any comments contact webmaster. http://www.mikroelektronika.co.yu/engl

Seite 185

Chapter 6 - SamplesPrevious page Table of contents Chapter overview Next page CHAPTER 6 The Samples Introduction6.1 Supplying the microcontroller6.2

Seite 186

Chapter 6 - Sampleslikely that a man who is breathing in fresh air will live longer than a man who's living in a polluted environment.For a prope

Kommentare zu diesen Handbüchern

Keine Kommentare