Presentation is loading. Please wait.

Presentation is loading. Please wait.

Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil.

Similar presentations


Presentation on theme: "Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil."— Presentation transcript:

1

2 Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil Vlček Projekt Anglicky v odborných předmětech, CZ.1.07/1.3.09/04.0002 je spolufinancován Evropským sociálním fondem a státním rozpočtem České republiky.

3 Numeral systems DecimalHexadecimalBinary 000 111 2210 3311 44100 55101 66110 77111 881000 191001 10A1010 11B1011 12C1100 13D1101 14E1110 15F1111 161010000 171110001 181210010 191310011 201410100

4 Use of numeral systems, rules of notation NoteType of the numeral systemSyntax of the notationExample 1.Binaryb’binary number’b’00110110’ B’00110110’ 2.Decimald’decimal number’.decimal number d’100’ D’100’.100 3.Hexadecimalh’hexadecimal number’ 0xhexadecimal number h’9F’ H’9F’ 0x9F 4.OctalO’octal number’O’777’ o’777’ 5.ASCIIA’character’ ‘character’ A’C’ a’C’ ‘C’ Binary system: work with the ports and SFRs Decimal system: counters, arithmetic Hexadecimal system: memory addressing ASCII set: work with the text strings Octal system: exceptionally (electric musical instruments)

5 The PIC16F833A instruction set The instruction set contains 33 instructions divided into the groups: Byte-oriented instructions Bit-oriented instructions Control instructions Work with the constants Examples of simple instructions: NOP Syntax:NOP Description: No Operation Example:NOP MOVWF Syntax:MOVWF f Description:Transfers data from the w register to the f register This instruction transfers data from the W working register to the register labelled (in the instruction) with the f symbol. For this symbol, we can then substitute any existing register or user variable which we created in the data memory area before. Examples:MOVWF PORTA MOVWF COUNTER MOVWF MY_CAT_LIZ

6 The PIC16F833A instruction set - continuation MOVLW Syntax:MOVLW,k Description: The k constant is inserted in the W working register. Example: MOVLW.110 GOTO Syntax:GOTOaddress Description: Program run control is transferred to the address in the program memory which is stated in the command parameter (0x2C, table). This is so-called unconditional jump – it is carried out in any case. Example:GOTO0x2C GOTOtable INCF Syntax:INCF f,d Description: The contents of the „f“ register is increased by 1. Example: INCF counter DECF Syntax:DECF f,d Description: The contents of the „f“ register is decreased by 1. Example: DECF counter

7 The PIC16F833A instruction set – overview

8

9 Summary of the subject matter What numeral systems which are used in electronics do you know ? Why to use different numeral systems? When is it more suitable to use a binary system and when, on the other hand, a decimal system? What is an ASCII character?

10 Summary of the subject matter What is the difference between a bit-oriented instruction and a byte-oriented instruction? When to use bit-oriented instructions and when, on the other hand, byte-oriented instructions? What is the sense of using NOP instructions?

11  Datasheet Microchip PIC16F882/883/884/886/887 DS41291E (http://www.microchip.com) References


Download ppt "Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil."

Similar presentations


Ads by Google