Micro-processor vs. Micro-controller

Slides:



Advertisements
Similar presentations
振動スイッチを活用 振動(傾き)を検出 ボールが移動 a)オン時 b)オフ時 オンからオフ時の観察.
Advertisements

Instruction formats for the PIC series. ROM encoding Instructions are encoded in binary in ROM. The instructions are fixed format, each occupying 14 bits.
Control structures Hot to translate high level control structures to assembler.
Electronics Design Lab TUTORIAL PIC Microcontrollers Francesco Tenore 2/10/2006.
Prof. Jorge A. Ramón Introducción a Microcontroladores.
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.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2013 Lecture 27: PIC instruction set.
Microprocessor Systems Design I
PIC18F Programming Model and Its Instruction Set
Rodolfo Rodriguez Kevin Zhang MJ Gellada
9/20/6Lecture 21 -PIC Architecture1 PIC Architecture Instruction Set.
Microcontroller Programming How to make something almost do something else Raffi Krikorian MAS November 2003.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Two’s Complement Number wheel for 4 bit numbers
Building Assembler Programs Chapter Five Dr. Gheith Abandah1.
Microprocessor and Interfacing PIC Code Execution
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.
Embedded System Spring, 2011 Lecture 5: The PIC Microcontrollers Eng. Wazen M. Shbair.
S5704A Tips & Tricks 11 © 1999 Microchip Technology Incorporated. All Rights Reserved. S5704A Tips & Tricks 11 Tips and Tricks Tips and Tricks Using PICmicro.
 Mini-Computer  Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output) Low-Cost.
EEE237 Introduction to Microprocessors Week x. SFRs.
Microcontroller (C) vs. Microprocessor (P)
Eng. Husam Alzaq The Islamic Uni. Of Gaza
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
PIC Code Execution How does the CPU executes this simple program? void main() { int i; i = 1; i++; }
V 0.41 C Arithmetic operators OperatorDescription +, -addition (i+j), subtraction (i-j) *, /multiplication (i*j), division (i/j) ++, --increment (i++),
Working with Time: Interrupts, Counters and Timers
Embedded System Spring, 2011 Lecture 11: Bank Switching Eng. Wazen M. Shbair.
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,
Microcontrollers A Practical Approach Ernesto Arroyo
Department of Electronic & Electrical Engineering Lecture 4. ➢ Loops ➢ Delays ➢ Conditional instructions ➢ Simple clock example.
Applications examples. A binary count : stepped manually and reset with push buttons. Define ports Reset portd Reset =0? INCF portd no Step =0? yes.
1.  List all addressing modes of PIC18 uCs  Contrast and compare the addressing modes  Code PIC18 instructions to manipulate a lookup table.  Access.
Chapter 9 PIC18 Timer Programming in Assembly
Microprocessor Systems Design I
Embedded Hardware.
Lecture – 5 Assembly Language Programming
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
C. K. PITHAWALA COLLEGE OF ENGINEERING AND TECHNOLOGY
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
PIC – ch. 2b Md. Atiqur Rahman Ahad.
PIC 16F877.
16.317: Microprocessor System Design I
Microprocessor Systems Design I
PIC18 CH. 4.
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
Chapter 4 Instruction Set.
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
INSTRUCTION SET.
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
Presentation transcript:

Micro-processor vs. Micro-controller

PIC16F877 40pin DIP CMOS technology RISC CPU 35 single word instructions DC-20MHz clock DC-200ns instruction cycle

PIC 16F877

Clock/Pipeline

Program Memory/Stack

Instruction Set Default destination STATUS Register Subtraction (Borrow Flag) W EQU H'0000' ; standard definitions F EQU H'0001'; ...to avoid having to write numbers incf var,W ; W = var + 1, var is unchanged incf var,F ; var = var + 1, W is unchanged addlw -2 sublw 2

Bit, Byte, Literal/Control Instruction Formats

Tool Chain (MPLAB/CCS) Programming facilities Pre-processor functions Code checking/warning Prepared include/library files Debug without hardware limited programming cycles safety -- bugs may blow equipment Debug with equipment on-line view of register values help to track down problems.

Lab Exercise: Failing loop test #device PIC16F877 *=8 ADC=8 void main() { int c; for (c=9;c<=255;c++); } 0000 3000 movlw 0x0 0001 008A movwf 0xA 0002 2804 goto MAIN 0003 0000 nop 0004 0184 MAIN clrf 0x4 0005 301F movlw 0x1F 0006 0583 andwf 0x3 0007 3009 movlw 0x9 0008 00A1 movwf 0x21 0009 0AA1 incf 0x21 000A 2809 goto 0x9 000B 0063 sleep

Working loop test (1) #device PIC16F877 *=8 ADC=8 void main() { int c; for (c=9;c<=254;c++); } 0000 3000 movlw 0x0 0001 008A movwf 0xA 0002 2804 goto MAIN 0003 0000 nop 0004 0184 MAIN clrf 0x4 0005 301F movlw 0x1F 0006 0583 andwf 0x3 0007 3009 movlw 0x9 0008 00A1 movwf 0x21 0009 30FF movlw 0xFF 000A 0221 subwf 0x21,W 000B 1803 btfsc 0x3,0x0 000C 280F goto 0xF 000D 0AA1 incf 0x21 000E 2809 goto 0x9 000F 0063 sleep

Working loop test (2) #device PIC16F877 *=8 ADC=8 void main() { long c; for (c=9;c<=255;c++); } 0000 3000 movlw 0x0 0001 008A movwf 0xA 0002 2804 goto MAIN 0003 0000 nop 0004 0184 MAIN clrf 0x4 0005 301F movlw 0x1F 0006 0583 andwf 0x3 0007 01A2 clrf 0x22 0008 3009 movlw 0x9 0009 00A1 movwf 0x21 000A 08A2 movf 0x22 000B 1D03 btfss 0x3,0x2 000C 2811 goto 0x11 000D 0AA1 incf 0x21 000E 1903 btfsc 0x3,0x2 000F 0AA2 incf 0x22 0010 280A goto 0xA 0011 0063 sleep

Another loop Fails #device PIC16F877 *=8 ADC=8 void main() { int c; do{}while (c++ <= 255); } 0000 3000 movlw 0x0 0001 008A movwf 0xA 0002 2804 goto MAIN 0003 0000 nop 0004 0184 MAIN clrf 0x4 0005 301F movlw 0x1F 0006 0583 andwf 0x3 0007 3009 movlw 0x9 0008 00A1 movwf 0x21 0009 2809 goto 0x9 000A 0063 sleep

While Loop OK! #device PIC16F877 *=8 ADC=8 void main() { int c; c=9; do { } while (c++!=255); } 0000 3000 movlw 0x0 0001 008A movwf 0xA 0002 2804 goto MAIN 0003 0000 nop 0004 0184 MAIN clrf 0x4 0005 301F movlw 0x1F 0006 0583 andwf 0x3 0007 3009 movlw 0x9 0008 00A1 movwf 0x21 0009 0821 movf 0x21,W 000A 0AA1 incf 0x21 000B 00F7 movwf 0x77 000C 0A77 incf 0x77,W 000D 1D03 btfss 0x3,0x2 000E 2809 goto 0x9 000F 0063 sleep