Microcontrollers BME 201. Overview Microcontrollers Notation Registers Timer Concepts Equations.

Slides:



Advertisements
Similar presentations
Machine cycle.
Advertisements

DAP teaching computer architecture at Berkeley since 1977
Assembly Language Programming
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
Digital Data Representation
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
CSS 372 Oct 2 nd - Lecture 1 Course Overview: CSS 372 Web page Syllabus Lab Ettiquette Lab Report Format Review of CSS 371: Simple Computer Architecture.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Introduction to Microprocessors Number Systems and Conversions No /6/00 Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
Computer Organization and Architecture Tutorial 2 Kenneth Lee.
Assembly Language for Intel-Based Computers, 4th Edition
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Introduction to Computing Systems (1st Exam). 1. [10] What is the range of decimal integers that can be represented by the following given numbers of.
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
1 Sec (2.3) Program Execution. 2 In the CPU we have CU and ALU, in CU there are two special purpose registers: 1. Instruction Register 2. Program Counter.
Assembly & Machine Languages
Technology in Action Alan Evans Kendall Martin Mary Anne Poatsy Tenth Edition Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.
Today’s Lecture List the Timers of PIC18 and their associated registers Describe the various modes of the PIC18 timers Program the PIC18 timers in Assembly.
1 CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2.
How Computers Work Dr. John P. Abraham Professor UTPA.
Lecture 11: Machine Processing Intro to IT COSC1078 Introduction to Information Technology Lecture 11 Machine Processing James Harland
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
The Hexadecimal Number System and Memory Addressing ISAT 121.
Converting From decimal to Binary & Hexadecimal to Binary
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
CMSC 150 PROGRAM EXECUTION CS 150: Wed 1 Feb 2012.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Data Manipulation, part two Introduction to computer, 2 nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
Chapter Microcontroller
Jeremy R. Johnson William M. Mongan
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
First Foray into Programming (the hard way). A reminder from last lesson: A machine code instruction has two parts:  Op-code  Operand An instruction.
One more PIC18F252 example and revision for exam B222L Branislav Vuksanovic, UoP, ECE.
Computer Organization Exam Review CS345 David Monismith.
Chapter 9 PIC18 Timer Programming in Assembly
A Closer Look at Instruction Set Architectures
Figure 8.1 Architecture of a Simple Computer System.
Software comes from heaven when you have good hardware. Ken Olsen
Chapter One: Introduction
CSCE Fall 2013 Prof. Jennifer L. Welch.
MIPS Instruction Encoding
Overview of Computer Architecture and Organization
Figure 8.1 Architecture of a Simple Computer System.
MIPS Instruction Encoding
Computer Architecture and the Fetch-Execute Cycle
The Little Man Computer
PIC18 Timer Programming “Explain the assembly language programming for the timer and counter module”
CS/COE0447 Computer Organization & Assembly Language
MARIE: An Introduction to a Simple Computer
CSCE Fall 2012 Prof. Jennifer L. Welch.
Introduction to Microprocessor Programming
Program Execution.
The Von Neumann Machine
Instruction execution and ALU
Timers Chapter 2.
CS/COE0447 Computer Organization & Assembly Language
Algoritmos y Programacion
Sec (2.3) Program Execution.
Little Man Computer.
Presentation transcript:

Microcontrollers BME 201

Overview Microcontrollers Notation Registers Timer Concepts Equations

Microcontrollers Made of millions of electrical components A little computer

Programming High-Level Language Assembly Language Machine Language Easy-to-understand abstract language 0 s or 1 s Hard to understand Defined by manufacturer a = b + cAdd a, b, c

Instruction Fetch and Execute 1.Fetch the instruction 2.Figure out what it is 3.Load the operands 4.Do the operation 5.Store the results (if necessary)

Notation Decimal (base 10): 0 – = (1x10 3 )+(2x10 2 )+(3x10 1 )+(4x10 0 )

Notation Binary (base 2): 0 or 1 0b0110 = (0x2 3 )+(1x2 2 )+(1x2 1 )+(0x2 0 ) = = 6 k

Notation Hexadecimal (base 16): 0 – 9, A – F A = 10 B = 11 … 0x5A0F = (5x16 3 )+(10x16 2 )+(0x16 1 )+(15x16 2 ) = a

Notation Page 49 of Handbook 0b x2 B BinaryHex BinaryHex A 1011B 1100C 1101D 1110E 1111F

Data Types Char – Single character: ‘a’, ‘f’, ‘\n’ Int – Whole number: 8, 124, -873 Double/Float – Decimal Number: 4.6, -2.7 Array – Collection of similar data: [1, -4, 3] String – ‘String’ of characters: “Hello World!”

Registers

Timer

Bit-Size 8-bit Counts 0 to (2 8 – 1) 0x00, 0x01, 0x02, … 0xFD, 0xFE, 0xFF 16-bit Counts 0 to (2 16 – 1) 0x0000, 0x0001, 0x0002, … 0xFFFD, 0xFFFE, 0xFFFF

Overflow 0x = 0x01 0x = 0x02 … 0x0F + 1 = 0x10 0x = 0x11 … 0xFE + 1 = 0xFF 0xFF + 1 = ?

Incrementing Counter Counter increments every instruction executed Each instruction executes in 4 clock cycle

Prescale Scales the increment rate 1:2, 1:4, 1:8, 1:32, 1:64, 1:128, 1:256

Start Bytes Start at a specific value 8-bit 0x00 TMR0L 16-bit 0x0000 TMR0H|TMR0 L

Timer Equation 1.Calculate timer increment 1.Determine bit-size 2.Calculate prescale 3.Calculate X (start bytes)

Registers T0CON TMR0H TMR0L Overflow: TMR0IF