INTRODUCTION TO PIC MICROCONTROLLERS INTRODUCTION TO PIC MICROCONTROLLERS Dr.Y.Narasimha Murthy Ph.D SRI SAIBABA NATIONAL COLLEGE(AUTONOMOUS)

Slides:



Advertisements
Similar presentations
Introduction to PIC Microcontrollers
Advertisements

Microprocessors A Beginning.
Parul Polytechnic Institute
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
8051 Core Specification.
The 8085 Microprocessor Architecture
EEE226 MICROPROCESSORBY DR. ZAINI ABDUL HALIM School of Electrical & Electronic Engineering USM.
Course Overview and The 8051 Architecture
Processor System Architecture
MICRO PROCESSER The micro processer is a multipurpose programmable, clock driven, register based, electronic integrated device that has computing and decision.
Microcontroller – PIC – 4 PIC types PIC architecture
1-1 Microprocessor Engineering Microprocessor Systems Microcontrollers Infineon 16-bit Processor Family  specifically 167CS microcontroller C Programming.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2013 Lecture 26: PIC microcontroller intro.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 30: PIC data memory.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
Microcontroller Architecture— PIC18F Family
Microcontroller Architecture PIC18F Family
The domestic refrigerator-An example A car door mechanism.
Micro controllers A self-contained system in which a processor, support, memory, and input/output (I/O) are all contained in a single package.
Ehsan Shams Saeed Sharifi Tehrani. What is DSP ? Digital Signal Processing (DSP) is used in a wide variety of applications, and it is hard to find a good.
1 © Unitec New Zealand Embedded Hardware ETEC 6416 Date: - 10 Aug,2011.
Atmega32 Architectural Overview
Minimum Systems and the PIC 16F84A Chapter Two Dr. Gheith Abandah1.
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
MICROOCESSORS AND MICROCONTROLLER:
Programmable Interrupt Controller (PIC)
Presented by Sadhish Prabhu
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Chapter Microcontroller
Components of a typical full-featured microcontroller.
AVR Architecture Prepared By: Avdhesh Soni ( ) Sarthak Patel ( ) Akshay Parekh ( ) Fenil Sachla ( ) Guided.
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Memory Organization 1.  3 types of memory are used in PIC18 microcontroller devices: Program Memory - Flash Memory Data RAM - Static RAM Data EEPROM.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
Embedded Microcontroller Systems
Seminar On 8085 microprocessor
PIC CONTROLLED DYNAMIC TIME BASED CITY TRAFFIC SIGNAL
MICROCONTROLLER ARCHITECTURE & ASSEMBLY LANGUAGE PROGRAMMING
Atmega32 Architectural Overview
Networking of Multiple street junction signals for better traffic management Submitted by:
DTMF BASED REMOTE INDUSTRIAL LOAD AND/OR AGRICULTURAL PUMP CONTROL
Embedded Microcontroller Systems
Microprocessor Systems Design I
UNIT – Microcontroller.
Microprocessor Systems Design I
DENSITY BASED TRAFFIC LIGHT TIMING CONTROL
Micro-Controller: PIC16C74 < Architecture >
Microprocessor Systems Design I
SYNCHRONIZED TRAFFIC JUNCTION SIGNALING (GET GREEN SIGNAL ALL-THROUGH AT ANY STREET JUNCTION)-A NEW CONCEPT TO EASE TRAFFIC CONGESTION IN METROS Submitted.
Project Title EVM IN PIC Under the Guidance of Submitted by.
PIC 8 BIT AND 16 BIT MICROCONTROLLER ARCHITECTURE
Microprocessor Systems Design I
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Chapter 1: The 8051 Microcontrollers
Introduction to Microprocessors and Microcontrollers
Interfacing Memory Interfacing.
EE Embedded Systems Fall 2015
INTRODUCTION TO PIC MICROCONTROLLERS
Introducing the PIC Mid-Range Family and the 16F84A
EECE.3170 Microprocessor Systems Design I
Presentation transcript:

INTRODUCTION TO PIC MICROCONTROLLERS INTRODUCTION TO PIC MICROCONTROLLERS Dr.Y.Narasimha Murthy Ph.D SRI SAIBABA NATIONAL COLLEGE(AUTONOMOUS)

CAN YOU IDENTIFY THIS GENTLEMAN ???..

None other than Steve Sanghi, the chairman, president and CEO of Microchip Technology Inc. Sanghi moved from India to U.S. to pursue a Master’s degree at the University of Massachusetts after bachelor’s degree in engineering, from Punjab Engineering College. In 1993, Sanghi became president and CEO of Microchip after seeking advice from venture capital firms on starting his own company.

Since then, he has transformed Microchip into a billion-dollar company specializing in Microcontroller and analog semiconductors used in devices ranging from remote controls to cars. He also has been involved in science and technology education programs, and he’s been known to frequent science fairs and question kids about their projects.

Brief Introduction…. The term PIC stands for “Peripheral Interface Controller”.It is the brain child of Microchip Technology, USA.They have coined this name to identify their single chip micro-controllers. These 8-bit micro controllers have become very important now -a -days in industrial automation and embedded applications etc…..

PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re- programming with flash memory) capability.

Microchip PIC microcontrollers are available in various types. When PIC microcontroller MCU was first available from General Instruments in early 1980's, the micro-controller had a simple processor executing 12-bit wide instructions with basic I/O functions. These devices are known as low-end architectures. They have limited program memory and are meant for applications requiring simple interface functions and small program & data memories.

Some of the low-end device numbers are 12C5XX 16C5X 16C505

Mid range PIC architectures are built by upgrading low-end architectures with more number of peripherals, more number of registers and more data/program memory. Some of the mid-range devices are 16C6X 16C7X 16F87X Program memory type is indicated by an alphabet. C = EPROM F = Flash RC = Mask ROM

One of the mid -range versions of PIC  Cs is PIC16C6x/7x. The 7x family has an enhancement of Analog to Digital converter capability. These  Cs are available with a range of capabilities packaged in both dual in-line (DIP) packages and surface-mount packages. These are available in 28 pin DIP,40 pin DIP,44 pin surface mount package etc..

In this 6x/7x family of Micro controllers, PIC 16C62A/PIC 16C74A are found with a suffix A. some of PIC do not contain this A. The presence of A indicates the brown-out reset feature, which causes a reset of the PIC when the Power Supply voltage drops below 4.0 V.

Salient features Speed : When operated at its maximum clock rate a PIC executes most of its instructions in 0.2  s or five instructions per microsecond. Instruction set Simplicity : The instruction set is so simple that it consists of just 35 instructions

Integration of operational features: Power-on-reset and brown-out protection ensure that the chip operates only when the supply voltage is within specifications. A watch dog timer resets the PIC if the chip malfunctions or deviates from its normal operation at any time. Programmable timer options: Three timers can characterize inputs, control outputs and provide internal timing for the program execution.

Powerful output pin control: A single instruction can select and drive a single output pin high or low in its 0.2  s instruction execution time. The PIN can drive a load of up to 25  A. I/O port expansion: With the help of built in serial peripheral interface the number of I/O ports can be expanded. EPROM/DIP/ROM options are provided.

I/O port expansion: This is the most important aspect in the PIC controllers.With the help of built in Serial Peripheral Interface(SPI) the number of I/O ports can be expanded. EPROM/DIP/ROM options are provided. Interrupt control: Up to 12 independent interrupt sources can control when the CPU will deal with each sources.

PIC 16C6X/7X CONTROLLERS PERIPHERAL FEATURES The PIC16CXX/17CXX is a family of low-cost, high-performance, CMOS, fully-static, 8-bit microcontrollers. There are Three Timers : Namely Timer 0, Timer1, Timer 2 Timer0: 8-bit timer/counter with 8-bit prescaler Timer1: 16-bit timer/counter with prescaler can be incremented during sleep via external crystal/clock Timer2: 8-bit timer/counter with 8-bit period register, pre- scaler and post- scaler

Contd… Contd… Capture/Compare/PWM (CCP) module(s) Capture is 16-bit, max resolution is 12.5 ns, Compare is 16-bit, max resolution is 200ns, PWM max resolution is 10-bit Synchronous Serial Port (SSP) with SPI TM and I2C Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)

Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls Brown-out detection circuitry for Brown-out Reset (BOR) PIC16CXX microcontroller family has enhanced core features, eight-level deep stack, and multiple internal and external interrupt sources.

ARCHITECTURE The high performance of the PIC16CXX family can be attributed to a number of architectural features commonly found in RISC microprocessors. To begin with, the PIC 16CXX uses a Harvard architecture, in which, program and data are accessed from separate memories using separate buses. This improves bandwidth over traditional Von Neumann architecture where program and data may be fetched from the same memory using the same bus.

HARVARD ARCHTECTURE

As the PIC 16c6x/7x family of micro-controllers uses Harvard Architecture it enables the devices exceptionally fast execution speed for a given clock rate. In the Harvard Architecture separate buses are used for Data and Instruction as shown in the diagram. Instructions are fetched from program memory using buses that are distinct from the buses used for accessing variables in data memory, I/O ports etc. Every instruction is coded as a single 14-bit word and fetched over a 14-bit wide bus.

Contd …. Contd …. Separating program and data buses further allows instructions to be sized differently than 8-bit wide data words. Instruction op-codes are 14-bits wide making it possible to have all single word instructions. A 14-bit wide program memory access bus fetches a 14-bit instruction in a single cycle

Example : The PIC 16C61 addresses 1K x 14 of program memory. The PIC16C62/62A/R62/64 addresses 2K x 14 of program memory, and the PIC16C63/R63/65/65/65A/R65 devices address 4K x 14 of program memory. The PIC 16C66/67 address 8K x 14 program memory. All program memory is internal.

The PIC16CXX can directly or indirectly address its register files or data memory. All special function registers including the program counter are mapped in the data memory. The PIC16CXX has an orthogonal (symmetrical) instruction set that makes it possible to carry out any operation on any register using any addressing mode. This symmetrical nature and lack of “special optimal situations” makes programming with the PIC16CXX simple yet efficient, thus significantly reducing the learning curve.

CPU REGISTERS The CPU registers are Working Register (W) Status – Register FSR – File Select Register INDF PCLATH Program Counter PCL Eight Level Stack

Contd…. Contd…. Working Register: Working Register is used by many instructions as the source of an operand. It also serves as the destination for the result of instruction execution and it is similar to accumulator in other  cs and  ps. It is a 8-bit regarding. Status Register: It contains the arithmetic status of the ALU, the RESET status and the bank select bits for the data memory.

C: Carry/borrow bit DC: Digit carry/borrow bit Z: Zero bit NOT_PD: Reset Status bit (Power-down mode bit) NOT_TO: Reset Status bit (tme- out bit) RPO: Register bank Select The bits 7 and 6 of Status Register are unused by 16c6x/7x.

The ‘C’ bit is set when two 8-bit operands are added together and a 9-bit result occurs. This 9-bit is placed in the carry bit. The DC or Digit carry bit indicates that a carry from the lower 4 bits occurred during an 8-bit addition. Contd…. Contd….

Example: Here DC=1 as a result of the carry from the bit 3 to the bit 4 position.

The Z or zero bits is affected by the execution of arithmetic or logic instructions. The reset status bits NOT_TO and NOT_PD are used in conjunction with PIC’s sleep mode. The micro controller can put itself to sleep mode to save power during intervals when it has nothing to do. It can be reset by any of three kinds. Upon reset the CPU can check these two reset status bits to determine which kind of event resettled it and then respond accordingly.

The Register bank select bit RPO is used to select either bank. When RPO=0, select Bank 0, RPO=1, select Bank 1. Example: bcf STATUS, RPO Select bank 0 bsf STATUS, RPO Select bank 1.

Contd… Contd… FSR – (File Select Register): It is the pointer used for indirect addressing. In the indirect addressing mode the 8-bit register file address is first written into FSR. It is a special purpose register that serves as an address pointer to any address through out the entire register file. INDF – (Indirect File): It is not a physical register addressing this INDF will cause indirect addressing. Any instruction using the INDF register actually access the register pointed to by the FSR.

Contd… Contd… PCL: PCL is actually the lower 8-bits of the 13-bit program counter. It can be read like any other register. PCLATH (Program Counter Latch): The upper 3-bits of PCLATH remains zero and serves no purpose, it is only when PC2 is written to that PCLATH is automatically written into the PC at the same time.

Memory organisation : It has three memory blocks. Program memory Data memory Stack

The 6x/7x family controllers have either 2k or 4k address of program memory. Normally a program memory of 2k addresses needs only a 11-bit program counter to access any address (211=2048=2k). A program memory of 4k address needs a 12- bit program counter. But this PIC family uses 13-bit program counter allowing the controllers to an 8k-program memory without changing the CPU structure. Program Memory

Two addresses in the program memory address space are treated in a special way by the CPU. The first address H’ 000’ being a go to mainline instruction the second special address, H’ 004’ being a ‘go to in service’ instruction can be assigned to this address to make the CPU to jump to the beginning of the Interrupt Service routine located elsewhere in the memory space.

When we deal with tables, if any tables are created they are assigned to addresses in the range H’005 – H’0FF’. For most of the applications this space is sufficient. The main line program begins after the tables.

Data memory (Register Files): Data Memory is also known as Register File. Register File consists of two components. General purpose register file ( RAM). Special purpose register file (similar to SFR in 8051).

The special purpose register file consists of input/output ports and control registers. Addressing from 00H to FFH requires 8 bits of address. However, the instructions that use direct addressing modes in PIC to address these register files use 7 bits of instruction only. Therefore the register bank select (RP0) bit in the STATUS register is used to select one of the register bank

Data Memory map Data Memory map

Block diagram

Limitations The PIC architectures have several limitations: Only a single accumulator A small instruction set Operations and registers are not orthogonal; some instructions can address RAM and/or immediate constants, while others can only use the accumulator Memory must be directly referenced in arithmetic and logic operations, although indirect addressing is available via 2 additional registers Register-bank switching is required to access the entire RAM of many devices

THANQ !! Wish you good luck