1 / 24

PIC18F

PIC18F. Architecture. PIC18F Architecture. PIC18F. Harvard Architecture Program Memory : Flash 4KB to 128KB Data Memory : SRAM 256 to 3968 bytes Data EEPROM: 128 bytes to 1KB if any 18 to 100 Pins I/O Pins : 16 to 70 25 MHz to 48 MHz.

shel
Download Presentation

PIC18F

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. PIC18F Architecture

  2. PIC18F Architecture

  3. PIC18F • Harvard Architecture • ProgramMemory: Flash 4KB to 128KB • Data Memory: SRAM 256 to 3968 bytes • Data EEPROM: 128 bytes to 1KB ifany • 18 to 100 Pins • I/O Pins: 16 to 70 • 25 MHz to 48 MHz

  4. MCU-MicrocontrollerUnitBlock Diagram

  5. MPU-MicroprocessorUnit & MemoryBlock Diagram

  6. PIC18F Architecture

  7. Program & Data Memories

  8. Data MemoryshowingAccess Bank & AddressRange

  9. I/O Ports • Five I/O ports • PORT A through PORT E • Most I/O pins are multiplexed • Generally have eight I/O pins with a few exceptions • Addresses already assigned to these ports in the design stage • Each port is identified by its assigned SFR

  10. I/O Ports

  11. Processes of Data Transfer

  12. MCU SupportDevices • Timers • CCP Modules: Capture, Compare and PWM • Serial Communications • MSSP: Master Synchronous Serial Port • Addressable USART • A/D converter • PSP: Parallel Slave Port • Data EEPROM

  13. MCU SupportDevices

  14. PIC18F SpecialFeatures • Sleep Mode • WDT: Watchdog Timer • Code Protection • In-Circuit Serial Programming • In-Circuit Debugger

  15. PIC18F Architecture

  16. PIC18F Instructions and Assembly Language • Has 77 instructions • Earlier PIC family of microcontrollers have either 33 or 35 instructions. Upward Compatible. • In PIC18F instruction set, all instructions are 16-bit word length except four instructions that are 32-bit length

  17. Instruction Description • Copy (Move) 8-bit number (Literal) into W register • Mnemonics: MOVLW 8-bit • Binary format: 0000 1110 XXXX XXXX (any 8-bit number) • Copy (Move) contents of W register into PORTC (File) • Mnemonics: MOVWF PORTC, a • (‘a’ indicates that PORTC is in the Access Bank) • Binary format: 0110 1110 1000 0010 (82H is PORTC address)

  18. Illustrative Program: Displaying a Byte at an I/O Port • Problem statement: • Write instructions to light up alternate LEDs at PORTC • Hardware: • PORTC • bidirectional (input or output) port; should be setup as output port for display • Logic 1 will turn on an LED

  19. Interfacing LEDs to PORTC

  20. Program • Logic 0 to TRISC sets up PORTC as an output port • Byte 55H turns on alternate LEDs • MOVLW 00 ;Load W register with 0 • MOVWF TRISC,0 ;Set up PORTC as output • MOVLW 0x55 ;Byte 55H to turn on LEDS • MOVWF PORTC,0 ;Turn on LEDs • SLEEP ;Power down

  21. AssembledProgram

  22. Execution of the instruction MOVWF PORTC

  23. MPLAB IDE Simulator

  24. EmbeddedSystem Microcontroller-based Time and Temperature System

More Related