Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Microcontrollers Z. Matej & S. Rerucha Spring 2013 Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 1 Basic concepts 2 Microchip PIC 3 8-bit PICs 4 16-bit PICs 5 32-bit PICs Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Microcontroller ...also referred to as: MCU, uC, µC. MCU is basically a “computer-on-a-chip”: microprocessor, data and program memory, I/O peripherals; usually also interrupt controller, timers, non-volatile storage (EEPROM) Various extra peripherals usually integrated : analog peripherals (A/D, D/A, comparators), serial communication (UART, SPI, IIC), drivers (LCD, PWM) Typically used for low-cost, space- and power-critical applications Simple architecture also allows for better real-time capabilities. Special branch of MCUs targeted at signal processing is recognized as the Digital Signal Controllers, DSCs. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Scale Data memory: from 16B to several MB Program memory: from 250 words to several MB Clock speed: typically a few MHz (1-20), 32kHz for ultra low power, 500+ for hi-end cores I/O size: from 6 pins (incl. power) Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff µC vs. microprocessor all components on a single chip fixed memory and I/O size for cost / power / space -critical applications reduced complexity ⇒ reliability, real-time response only processing unit, the rest connected externally modularity: arbitrary I/O and memory performance versatile, expandable Nowadays both can be either general purpose or application specific. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff MCU Taxonomy architecture: Von Neumann, (Modified) Harvard instruction set: RISC, CISC, ... addres bus width: 8-, 16-, 32-, 64-bit platform: IC, soft-core family: acording to manufacturer (see [1]) Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Harvard vs. von Neumann In Von Neumann architecture, the data and program memory are stored in a single memory ⇒ more universal concept In Harvard architecture, there are separate memories and buses for data and program memory ⇒ simultaneous access to instructions and data, different bus widths. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Basic models developed Modified Harvard architecture: the architecture allows for modification of the program memory from the system itself, e.g by special instructions Memory mapped I/O: the peripheral interfaces are mapped into single continguous memory space. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Instruction sets Complete Instruction Set Computer (CISC): large instruction set performing even complex tasks; usually takes several clock cycles to execute – e.g. Intel 80x86, Zilog Z80, 8051 Reduced Instruction Set Computer (RISC): small instruction set, fast and fixed time execution (good for pipelining); complex task are done as a combination of more instructions – e.g. ARM, Sparc, Atmel AVR MIPS, PowerPc, PIC Today, an amorphous combination is typically used, the only CISC computers are x86s. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Introducing PICs PIC ... Peripheral Interface Controller or Programable Intelligent Controller by Microchip company Popular for wide range of devices with uniform design concepts, low cost devices, free or low cost development tools, serially reprogrammable instruction memory, large user base, extensive collection of application notes and support materials. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff PIC families 8-bit controllers: PIC10, PIC12, PIC16, PIC18 16-bit general purpose: PIC24F, PIC24H/E 16-bit digital signal controllers: dsPIC30, dsPIC33 32-bit controllers: PIC32 Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff General properties Modified Harvard architecture – separate code and data space RISC – small amount of fixed-length instructions single cycle instruction execution (1-4 clock cycles) small adressable data space, extended through banking memory-mapped registers & peripherals (all in single address space) low power consumption: scalable oscillators, power-down modes, peripherals disabling hardware stack (8-bits) Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Typical features General purpose I/O pins Internal clock oscillators 8/16/32-bit timers Watchdog timer with separate clock oscillator. Internal non-volatile memory (EEPROM) ICSP – in-circuit serial programming Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff Typical features II. Synchronous/Asynchronous Serial Interface USART. MSSP Peripheral for I2C and SPI Communications. Capture/Compare and PWM modules Analog peripherals: A/D converters (up to 1.0 MHz), DAC, comparator, voltage references USB, Ethernet, CAN interfacing support. External memory interface. Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 8-bit Core Architectures Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 8-bit Families Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 8-bit Baseline architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 8-bit Mid-range architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 8-bit Enhanced mid-range architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 8-bit PIC18 architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 16-bit Families Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 16-bit PIC24F architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 16-bit PIC24E/H architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 16-bit dsPIC30 architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 16-bit dsPIC33 architecture Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff 32-bit Family Basic concepts Microchip PIC 8-bit PICs 16-bit PICs 32-bit PICs Final stuff References [1] List of common microcontrollers http://en.wikipedia.org/wiki/List_of_common_microcontrollers [2] Microchip company website http://www.microchip.com