1 / 26

Prof. Jorge A. Ramón

Prof. Jorge A. Ramón. Introducción a Microcontroladores. Microcontroller. Microprocessor. VS. CISC Architecture Many pins Many instructions External devices needed for operation (memory, I/O, etc). RISC Architecture Fewer pins Fewer instructions

elita
Download Presentation

Prof. Jorge A. Ramón

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Microcontroller Microprocessor VS • CISC Architecture • Many pins • Many instructions • External devices needed for operation (memory, I/O, etc) • RISC Architecture • Fewer pins • Fewer instructions • 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 68 bytes 8 bits 1K x 14 35 instructions 64 bytes 5 bits 8 bits

  11. 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 .

  12. PORTA Configuration

  13. PORTB Configuration

  14. PIC16F84 Register File

  15. PIC16F84 Status Register

  16. Instruction Set Summary • Byte Oriented • Bit Oriented • Literal • Control Operations Only 35 instructions!! Impressive!!!

  17. Byte Oriented • CLRF • DECF • INCF • ADDWF

  18. Bit Oriented • BCF • BSF

  19. Literal • MOVLW • ADDLW • ANDLW • IORLW • XORLW

  20. Control Operations • CALL • RETURN • GOTO • SLEEP

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

  22. Programming Example Setting PORTB as Output • BSF STATUS, RP0 • MOVLW 0x00 • MOVWF TRISB • BCF STATUS, RP0 • MOVLW 0xFF • MOVWF PORTB

  23. Assembly Programming Steps to write some code • Tell the assembler which MPU you are using. • Include the header file. • Set PC to 0 • Write some code • Keep an endless loop. • Use the end directive.

  24. PIC16F84 Schematic Diagram

More Related