Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prof. Jorge A. Ramón Introducción a Microcontroladores.

Similar presentations


Presentation on theme: "Prof. Jorge A. Ramón Introducción a Microcontroladores."— Presentation transcript:

1 Prof. Jorge A. Ramón Introducción a Microcontroladores

2 MicroprocessorVS Microcontroller 1.CISC Architecture 2.Many pins 3.Many instructions 4.External devices needed for operation (memory, I/O, etc) 1.RISC Architecture 2.Fewer pins 3.Fewer instructions 4.No external devices needed for operation (memory, I/O, etc are already built into IC)

3 Bloque #1 Unidad de Memoria

4 Bloque #2 Unidad Central de Procesamiento

5 Bloque #3 Unidad entrada y salida

6 Bloque #4 Unidad de comunicación en serie

7 Bloque #5 Unidad de Timer

8 Bloque #6 Unidad ADC

9 Conexión entre todas las unidades.

10 Microchip PIC16F84 Microcontroller Outline 8 bits 5 bits 35 instructions 64 bytes 68 bytes 1K x 14

11

12 Clock / Instruction Cycle Q1  Instruction Fetch Q2  Instruction Decode Q3  Execute Q4  Write Back Pipelining: each instruction is executed in one cycle. Two cycles for JUMP and CALL instructions.

13

14 PORTA Configuration

15 PORTB Configuration

16 PIC16F84 Register File

17 PIC16F84 Status Register

18 Instruction Set Summary Byte Oriented Bit Oriented Literal Control Operations Only 35 instructions!! Impressive!!!

19 Byte Oriented CLRF DECF INCF ADDWF

20 Bit Oriented BCF BSF

21 Literal MOVLW ADDLW ANDLW IORLW XORLW

22 Control Operations CALL RETURN GOTO SLEEP

23 Programming Example Setting PORTB as Output 1. Set RP0 in Status Register to switch to BANK1. This allows access to TRISB. 2. Write 0x00 into TRISB. 3. Clear RP0 in Status Register to switch to BANK0. This allows access to PORTB.

24 Programming Example Setting PORTB as Output 1. BSF STATUS, RP0 2. MOVLW 0x00 3. MOVWF TRISB 4. BCF STATUS, RP0 5. MOVLW 0xFF 6. MOVWF PORTB

25 Assembly Programming Steps to write some code 1. Tell the assembler which MPU you are using. 2. Include the header file. 3. Set PC to 0 4. Write some code 5. Keep an endless loop. 6. Use the end directive.

26 PIC16F84 Schematic Diagram


Download ppt "Prof. Jorge A. Ramón Introducción a Microcontroladores."

Similar presentations


Ads by Google