PIC Processor Design CPE 428/528 April 29, 2002 Dr. Milenkovic Presented by: David Fatzer Le Pitts William Cruger Donn Hall.

Slides:



Advertisements
Similar presentations
Microprocessors A Beginning.
Advertisements

Microprocessors and Interfacing
Microprocessors.
Parul Polytechnic Institute
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
Chapter 2 HARDWARE SUMMARY
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
EEE226 MICROPROCESSORBY DR. ZAINI ABDUL HALIM School of Electrical & Electronic Engineering USM.
Processor System Architecture
Octavian Cret, Kalman Pusztai Cristian Vancea, Balint Szente Technical University of Cluj-Napoca, Romania CREC: A Novel Reconfigurable Computing Design.
Prof. Jorge A. Ramón Introducción a Microcontroladores.
TK 2633 Microprocessor & Interfacing
Aug. 24, 2007ELEC 5200/6200 Project1 Computer Design Project ELEC 5200/6200-Computer Architecture and Design Fall 2007 Vishwani D. Agrawal James J.Danaher.
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Pyxis Aaron Martin April Lewis Steve Sherk. September 5, 2005 Pyxis16002 General-purpose 16-bit RISC microprocessor bit registers 24-bit address.
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 based system design
Chapter 17 Microprocessor Fundamentals William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper.
Microcontroller Architecture PIC18F Family
9/20/6Lecture 21 -PIC Architecture1 PIC Architecture Instruction Set.
Machine Instruction Characteristics
MICROPROCESSOR INPUT/OUTPUT
Directives, Memory, and Stack. Directives Special commands to the assembler May or may not generate machine code Categories by their function Programming.
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Experiment 7 VHDL Modeling of Embedded Microprocessors and Microcontrollers.
PIC18F Programming Model and Instruction Set
Lecture – 4 PIC18 Family Instruction Set 1. Outline Literal instructions. Bit-oriented instructions. Byte-oriented instructions. Program control instructions.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Z80 Overview internal architecture and major elements of the Z80 CPU.
Electronic Analog Computer Dr. Amin Danial Asham by.
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,
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.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
V 0.41 C Arithmetic operators OperatorDescription +, -addition (i+j), subtraction (i-j) *, /multiplication (i*j), division (i/j) ++, --increment (i++),
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
PIC12F629/675. “Wide variety” 8-84 pin RISC core, 12/14/16bit program word USART/AUSART, I 2 C, ADC, ICSP, ICD OTP/UV EPROM/FLASH/ROM Families: PIC12,
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Block diagram of a computer system Basic components of a computer system using block diagrams: Cpu Memory Input and output unit Evolution of microprocessor.
MICROPROCESSOR INTEL 8086/8088 BY: SERA SYARMILA SAMEON.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Microprocessor Systems Design I
Microprocessor Systems Design I
Gunjeet Kaur Dronacharya Group of institutions
Microprocessor Systems Design I
Microprocessor Systems Design I
C. K. PITHAWALA COLLEGE OF ENGINEERING AND TECHNOLOGY
Microprocessor Systems Design I
Introduction of microprocessor
PIC – ch. 2b Md. Atiqur Rahman Ahad.
PIC 16F877.
Microprocessor Systems Design I
PIC18 CH. 4.
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Introduction to Microprocessors and Microcontrollers
Number Representations and Basic Processor Architecture
Chapter 4 Instruction Set.
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
Computer Architecture Assembly Language
Computer Operation 6/22/2019.
Presentation transcript:

PIC Processor Design CPE 428/528 April 29, 2002 Dr. Milenkovic Presented by: David Fatzer Le Pitts William Cruger Donn Hall

Introduction Project Description – Build a Soft Core for a PIC18 Series Microcontroller Motivation – Desire to Gain Further Understanding of Microprocessor Architecture – Apply VHDL Techniques to a Real-World Situation

Platform FPGA – Spartan II – 600 Complex Logic Blocks (20x30) – 100,000 Gates – 10 Configurable 4K bit block RAMs – Dedicated carry logic for high-speed arithmetic

Spartan II Demo Board 2-Digit LCD RS-232 Port User LED’s User Switches 2.5 and 3.3 Volt Regulators JTAG Port Oscillator, 30MHz – 50MHz

Demo Board Modifications MHz Oscillator LCD Module Display 4 Lines x 20 Characters 5V Power Source for LCD

Development Tools Model Technology – ModelSim – VHDL Composition – Pre-Synthesis Testing Xilinx ISE WebPack – VHDL Synthesis – VHDL Implementation MicroChip MPLAB Assembler – ROM test code

PIC Description Microcontrol Unit 16-bit Wide Instruction Width 8-bit Wide Data Bus Two-Stage Pipeline Single Cycle Execution versus Microchip’s Four Cycle Execution

PIC Components ROM Register File Data Processing Unit Instruction Fetch Unit Instruction Decode Unit Reset Controller Input/Output Latches

ROM Provides Storage – OP-Codes – Data Constants – Strings for Test and Application Code Includes 256 x 16-bit Words Utilizes On-Chip Block RAM

Register File Provides the Following – Storage and Decoding for One Bank of a bit General Purpose Register – Decoding for Special Function Registers – Five Condition Code Registers Utilizes 4096-bit on Chip Block RAM

Data Processing Unit (DPU) Handles all Data Processing Functions Components – Arithmetic Logic Unit (ALU) – Multiplier – Rotate Unit (RU) – Bit Operation Unit (BOU) – Working Register (WREG/Accumulator)

Data Processing Unit (DPU) Register File Rotator Unit Multiplier MuxAMuxB ALU Bit Unit WREG Literal Bus FileWriteBus FileReadBus WRegBus

DPU – Arithmetic Logic Unit Two 8-bit Inputs One 8-bit Output Four Operations - AND, OR, XOR, ADD Pre-Conditioners – PASS – Do Nothing to the Input – INVERT – Invert the Input – Force0 – Force the Input to all Zeroes – Force1 – Force the Input to all Ones Generates Condition Codes

DPU – Arithmetic Logic Unit

ALU Condition Codes Condition CodeImplementation Negative1 when AluResult(7) = 1 Zero1 when AluResult(7..0) = all 0s Carry1 when AluCarry(7) = 1 Overflow1 when AluCarry(7) != AluCarry(6) DigitCarryNot yet implemented

DPU – Multiplier Single Cycle Using Combinatorial Array Multiplier Two 8-bit Unsigned Inputs One 16-bit Unsigned Output Stored in Two 8-bit Special Function Registers

DPU – Rotate Unit Performs Single Position Rotate and Nibble Swapping Combinatorial Implementation

DPU – Rotate Unit Rotate Unit Operations RotateUnitFunctionCodeEffect on Stack Pointer RLCFRotate Left through Carry RLNCFRotate Left RRCFRotate Right through Carry RRNCFRotate Right SWAPSwap Nibbles

DPU – Bit Operation Unit Provides Mask for Bit-Oriented Operations Bit Operation Decoding Instruction Word Bits[11..9]Bit Operation Unit Output Bits[7..0]

DPU – Working Register Provides a Temporary Storage Register That Serves as an Accumulator For All Data Processing instructions, Bit 9 Determines whether the Result of the Operation is Stored in Working Register or the Register File

Instruction Fetch Unit (IFU) Updates Program Counter Manages Hardware Return Stack Updates Instruction Register Manages Table Pointer

IFU – Block Diagram

IFU – Program Counter 21-bits (2MB Address Space) Asynchronous Reset Updated on Rising Edge of Clock ProgramCounterOpcode Determines Function

IFU – Program Counter Program Counter Opcodes ProgramCounterOpcodeEffect on PC NextInstructionIncrement to next address (+1) BranchRelativeOffset8Add 8-bit signed offset (-127 to +128) BranchRelativeOffset11Add 11-bit signed offset (-1024 to +1023) BranchAbsoluteForce new 21-bit value (GOTO) RestoreFromTopOfStackUse top of return stack value (RETURN) DontFetchDo not change (+0) InterruptHighPriorityForce to high priority interrupt vector (address 8) InterruptLowPriorityForce to low priority interrupt vector (address 18)

IFU – Return Stack 21-bit Wide by 16 Deep Stores Return Addresses Implemented Using Block RAM

IFU – Return Stack Stack Pointer Operations StackOpcodeEffect on Stack Pointer StackNOPDo not change (+0) StackPUSHAdd 1 then store (pre-increment) StackPOPRetreive then subtract 1 (post-decrement)

IFU – Instruction Register Latches Instructions from Program Data Bus Two-Stage Pipeline – Fetch Next Instruction – Decode & Execute Current Instruction

IFU – Instruction Register Instruction Register Operations InstructionRegisterOpcodeEffect on Instruction Register LatchNextInstructionLatch new instruction ForceNOPForce instruction register to all 0’s (NOP)

IFU – Table Pointer Instruction Facilitates Movement of Data to and from the ROM 21-bits Wide to Address 2MB of ROM Table Latch Register – Bridge for Program and Data Buses

IFU – Table Pointer Instruction Table Address Assignments Instruction Register(1:0) Operation on Table Pointer Next Value Table Address 00No changeTable Pointer 01Post-IncrementTable Pointer + 1Table Pointer 10Post-DecrementTable Pointer - 1Table Pointer 11Pre-IncrementTable Pointer + 1Table Pointer Next Value

IFU – Table Pointer Instruction Table Function Op-Codes TableFunctionOpCodeOperation on Table Latch (TABLAT) TableFunctionNOPNo change TableFunctionReadContents of TableAddress are written to TABLAT TableFunctionWriteContents of TABLAT written to ROM at TableAddress

IFU – Table Pointer Instruction Key Signals – Program Address Address Bus to ROM Normally Follows Program Counter Follows Table Address For Table Pointer Instructions – Program Data Data Bus From the ROM High-Impedance Except on TableFunctionWrite –TableFunctionWrite Used to Program Flash

Instruction Decoder - ID Three Distinct Stages of Design – Instruction Disassembler Identifies Instruction from Opcode – Define Global Decode Signals – Assign Global Decode Signals Must Include all Global Signals in Each Instruction to Avoid Latches

ID – Instruction Disassembler Instruction Decoder Grouping Group # Instruction Bits(15..12) Assembly Instruction 0000NOP, MOVLB, RESET, RETFIE, RETURN, CLRWDT, DAW, POP, PUSH, SLEEP, TBLRD, TBLWT, DECF, SUBLW, IORLW, XORLW, ANDLW, RETLW, MULLW, MOVLW, ADDLW 0001IORWF, ANDWF, XORWF, COMF 0010ADDWF, ADDWFC, DECFSZ, INCF 0011INCFSZ, RLCF, RRCF, SWAPF 0100DCFSNZ, INFSNZ, RLNCF, RRNCF 0101SUBFWB, SUBFW, SUBWFB, MOVF 0110CPFSEG, CPFSGT, CPFSLT, CLRF, SETF, MOVWF, NEGF, TSTFSZ 0111BTG 1000BSF 1001BCF 1010BTFSS 1011BTFSC 1100MOVFF 1101BRA, RCALL 1110BC, BN, BNC, BNN, BNOV, BNC, BOV, BZ, GOTO, CALL, LFSR 1111NOP (Second half of two-word instruction)

ID – Global Decode Signals Signal NameSignal Function MuxASelectSelects either register file or literal value for ALU input A MuxBSelectSelects either W-Register or Bit-Op value for ALU input B RotateUnitEnableEnables Rotate Unit RotateUnitFunctionCodeSelects RU function (Rotate Left, Right, with/without carry) ALUEnableEnables ALU ALUFunctionCodeALU function code (AND, OR, XOR ADD) ALUBusACondCodeALU input a conditioner (Pass, Invert, Force0s, Force1s) ALUBusBCondCodeALU input B conditioner (Pass, Invert, Force0s, Force1s) ALUCarryCondCodeALU carry input conditioner (Pass, Invert, Force0, Force1) BitOpEnableEnables Bit-Op unit BitOpPositionSelects Bit-OP position ( 1,2,4,8,16,32,64,128 ) UpdateConditionCodesSet to 1 to enable change in corresponding condition code WRegWriteEnableEnables writes from WriteBus to WREG on next rising edge FileWriteEnableEnables writes from WriteBus to Register File on next rising edge ProgramCounterOpCodeTells how to prepare Program Counter for next cycle InstructionRegisterOpcodeTells how to prepare Instruction Register for next cycle StackOpCodeStack function code. (Push, Pop, Nop) MultiplierEnableEnables single-cycle combinatorial multiplier ClearWatchdogTimerSet to 1 by CLRWDT instruction to clear watchdog timer SoftwareResetSet by RESET instruction to reset unit BSRWriteEnableSet to enable updates to Bank Select Register DAWEnableEnables Decimal Adjust Accumulator Unit TableFunctionOpCodeTable-pointer function code. (Read, Write, NOP) SleepModeSet by SLEEP instruction to freeze clock until next external reset

Reset Controller - RC Provides Global Reset Signal to PIC Reset Sources – External Reset – Software Reset – Stack Error – Watchdog Timeout Watchdog Timer Module

RC - Watchdog Timer Module 17-Stage Ripple Counter 36ms Timeout Based On MHz Asynchronous Clear – Reset – Clear from CLRWDT Instruction

Input/Output Latches Provides Three 8-bit Bi-Directional Ports for Parallel Communications Two of the Three Ports are for Communication with the LCD Module

Implementation Results

Device Utilization - 74% Clock Cycle – MHz – Multiplier Determines Critical Datapath

Design Process Assembly Program Assembler Converter (.HEX to ASCII) Load ROM (Copy/Paste)ModelSim Simulation/Verification VHDL Model Synthesis

Future Consideration Core for Future System-On-Chip Designs Further Exhaustive Testing External Flash Memory Implementation High-Level Language Applications ASIC Synthesis

Questions?