Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Size: px
Start display at page:

Download "Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff"

Transcription

1 Hardware Flags and the RTI system 1

2 Need for hardware flag Often a microcontroller needs to test whether some event has occurred, and then take an action For example A sensor outputs a pulse when a model train approaches a crossing The MCU must sense this pulse and then lower the crossing gate sensor MCU To make sure that it doesn t miss the input pulse, the MCU must continually read the input signal very rapidly This means that it can t do anything else (e.g., sensing and controlling other gates) 2

3 Hardware flag Instead of continuously reading an input signal, it is much more efficient to have the input signal set a hardware flag (i.e., a flip-flop) Then the MCU can occasionally read the flip-flop and tell that the event occurred it doesn t have to catch the input pulse when it happens No need to rapidly poll the input V DD (ie, logic 1) D flip-flop D Q Computer tests flag Device sets flag (on rising edge of input signal) CLR Computer clears flag We assert CLR to force the flip-flop to zero (this is an asynchronous control input) 3

4 Timing for the two methods Rapidly polling input signal read signal detect signal time n input set? y output control signal Occasionally polling hardware flag flag set? y n do other useful things read flag detect flag time output control signal clear flag 4

5 Recall that input/output ports are assigned to memory addresses Input is done by reading to that address Output is done by writing to that address A hardware flag looks like a bit in a memory location You can sense whether the flag is set by reading that bit You can clear the flag by writing to that bit Memory mapped IO 5

6 Flag Reading and Clearing You read a flag by reading the bit from the data bus If a read occurs to that address, signal R/W is set to 1 V DD D Q Data bus Event signal CLR You clear a flag by writing a 1 to that bit on the data bus If a write occurs to that address, signal R/W is set to 0 R/W Note: you clear a flag (ie, set it to zero) by writing a 1 to it (nonintuitive!) 6

7 Timer flags Flags are set by many kinds of events Some are caused externally (e.g., by an input signal) Others are caused internally Timers are an example of an internal event A counter automatically counts up every clock tick When it reaches a certain value, a flag is set This is a much better way to estimate time than using delay loops! Doesn t waste (as many) CPU cycles Can be more accurate 7

8 Example: RTI System Real Time Interrupt (RTI) system provides a periodic timer Clock divider is set in register RTICTL The period (in units of OSCCLK cycles) is determined by bits RTR0..RTR6 when timeout occurs, the RTIF flag (a flipflop) is set RTIF Counter RTR6:RTR0 Frequency divider RTICTL OSCCLK reset: RTR6 RTR5 RTR4 RTR3 RTR2 RTR1 RTR Figure 6.16 CRG RTI control register (RTICTL) 8

9 N The period (in units of OSCCLK cycles) is (N+1)*2 (M+9), where N is the bit field RTR3 through RTR0 Table 6.4 RTI interrupt period (in units of OSCCLK cycle) RTR[3:0] 0000 ( 1) 0001( 2) 0010 ( 3) 0011 ( 4) 0100 ( 5) 0101 ( 6) 0110 ( 7) 0111 ( 8) 1000 ( 9) 1001 ( 10) 1010 ( 11) 1011 ( 12) 1100 ( 13) 1101 ( 14) 1110 ( 15) 1111 ( 16) M is the bit field RTR6 through RTR4 000 (off) 001 (2 10 ) (2 11 ) RTR[6:4] 011 (2 12 ) M 100 (2 13 ) (2 14 ) (2 15 ) (2 16 ) M=0 means RTI off 9

10 RTI Flag CRGFLG register RTIF is bit 7 of CRGFLG Check this bit to see if a timeout has occurred Reset the flag by writing a 1 to that bit RTIF reset CRGFLG Register There are other flags in bits 6:0... their names aren t shown 10

11 A note about clocks An external crystal is used to generate a square wave called OSCCLK In our board it is 8 MHz This goes into a phase-locked loop (PLL) circuit which increases the frequency to 48 MHz makes it stable (v.s. jitter, skew, etc) The PLL clock is divided by 2 to make the 24 MHz E-clock But the RTI system uses the original 8 MHz OSCCLK OSCCLK (8 MHz) E-clock (24 MHz) Colpitts oscillator circuit 11

12 Example Set up the RTI system to generate periodic timeouts at intervals of approximately 0.01 second 12

13 Example Set up the RTI system to generate periodic timeouts at intervals of approximately 0.01 second Solution: The desired frequency of timeouts is 100 Hz We want to get the 8 MHz OSCCLK frequency down to 100 Hz So divide by a factor of 8 MHz/100 Hz = is 10*8000, and 8000 is about 2^13 We can get this by setting N=9, M=4 So RTR[3:0] = 9, RTR[6:4] = 4 Code: RTICTL = 0x49; 0x49 in binary is

14 Example N = = 9 10 Table 6.4 RTI interrupt period (in units of OSCCLK cycle) RTR[3:0] 0000 ( 1) 0001( 2) 0010 ( 3) 0011 ( 4) 0100 ( 5) 0101 ( 6) 0110 ( 7) 0111 ( 8) 1000 ( 9) 1001 ( 10) 1010 ( 11) 1011 ( 12) 1100 ( 13) 1101 ( 14) 1110 ( 15) 1111 ( 16) 000 (off) 001 (2 10 ) (2 11 ) RTR[6:4] 011 (2 12 ) (2 13 ) M = = (2 14 ) (2 15 ) (2 16 )

15 Example What s the slowest period for the RTI system, assuming a 8 MHz OSC clock? 15

16 Example What s the slowest period for the RTI system, assuming a 8 MHz OSC clock? Solution: From the table, 16*(2^16) is the slowest period This is 2^20, or about 10^6 cycles At us per cycle, this is sec So we get about 8 timeouts per second 16

17 Example - heartbeat Flash an LED at a rate of about 1 per second I.e., turn on for one second, then turn off for 1 sec This is kind of a heartbeat indicator by which you can tell your program is running The slowest RTI timeout rate is 8/second So we only want to take an action every 8 th timeout We will have to keep a count of timeouts Every time we sense a timeout, we increment the counter When the counter reaches 8, we reset the counter to zero and toggle the LED PT0 17

18 Example - heartbeat (continued) Psuedocode Set up PT0 for output Set up RTI rate for slowest rate initialize count = 0 while (true) while (RTIF is clear) do nothing clear RTIF by writing a 1 to it increment count end if count = 8 toggle PT0 count = 0 end 18

19 C code Example - heartbeat (continued) int count = 0; DDRT = 0x01; // Set up PT0 for output RTICTL = 0x7f; // Set up slowest RTI rate while (1) { while (!(CRGFLG & 0x80)) ; // wait till RTIF set // Clear RTIF by writing a 1 to it. // Writing 0 s to other flag bits doesn t affect them. // Don t do CRGFLG = 0x80; this will clear other flags CRGFLG = 0x80; } count++; if (count == 8) { PTT ^= 0x01; count = 0; } // toggle PT0 19

20 Example wag tail Assume PWM channel 4 is set up to control a servo motor, such that duty = 10 moves the motor all the way left, and duty = 20 moves the motor all the way right. Gradually move the motor from all the way left to all the way right over a period of about 20 seconds. Approach: We ll use the RTI system to generate timeouts every ~0.125 seconds (i.e., 8 per second). We will need to increment the duty cycle 10 times over 20 seconds. Or, increment it once every 2 seconds. Each RTI timeout occurs about seconds, so in 2 seconds we have 2.0/0.125= 16 timeouts Every 16 th timeout, increase the PWM duty cycle a little more 20

21 Example wag tail (continued) // Some code to set up PWM channel 4 follows... // : // Set up RTI system to generate timeouts at the slowest rate. The period // is about seconds. RTICTL = 0x7f; // longest possible period // We will need to increment the duty cycle 10 times over 20 seconds. // Or, increment it once every 2 seconds. Each RTI timeout occurs // every seconds, so in 2 seconds we have 2.0/0.125 = 16 timeouts. PWMDTY4 = 10; for (i=0; i<10; i++) { for (j=0; j<16; j++) { while (!(CRGFLG & 0x80)) ; } CRGFLG = 0x80; } PWMDTY4++; // wait for RTI timeout // Clear RTIF by writing a 1 to it // increment duty time 21

22 Summary / Questions A hardware flag is just a flip-flop. When an event occurs (i.e., a signal is received), the flag is set. Then the computer can read the flag later and see that the event had occurred. An example of a system that sets a hardware flag is the RTI system. It is just a periodic timer. Why is the flag system better than just directly sensing the event, for example by continuously reading an input pin? 22

PWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

PWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff PWM System 1 Pulse Width Modulation (PWM) Pulses are continuously generated which have different widths but the same period between leading edges Duty cycle (% high) controls the average analog voltage

More information

EEL 4744C: Microprocessor Applications Lecture 8 Timer Dr. Tao Li

EEL 4744C: Microprocessor Applications Lecture 8 Timer Dr. Tao Li EEL 4744C: Microprocessor Applications Lecture 8 Timer Reading Assignment Software and Hardware Engineering (new version): Chapter 14 SHE (old version): Chapter 10 HC12 Data Sheet: Chapters 12, 13, 11,

More information

Reading Assignment. Timer. Introduction. Timer Overview. Programming HC12 Timer. An Overview of HC12 Timer. EEL 4744C: Microprocessor Applications

Reading Assignment. Timer. Introduction. Timer Overview. Programming HC12 Timer. An Overview of HC12 Timer. EEL 4744C: Microprocessor Applications Reading Assignment EEL 4744C: Microprocessor Applications Lecture 8 Timer Software and Hardware Engineering (new version): Chapter 4 SHE (old version): Chapter 0 HC Data Sheet: Chapters,,, 0 Introduction

More information

LM4: The timer unit of the MC9S12DP256B/C

LM4: The timer unit of the MC9S12DP256B/C Objectives - To explore the Enhanced Capture Timer unit (ECT) of the MC9S12DP256B/C - To program a real-time clock signal with a fixed period and display it using the onboard LEDs (flashing light) - To

More information

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones 1 Announcements HW8: Due Sunday 10/29 (midnight) Exam 2: In class Thursday 11/9 This object detection lab

More information

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs. Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs. 1 The purpose of this course is to provide an introduction to the RL78 timer Architecture.

More information

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss Grundlagen Microcontroller Counter/Timer Günther Gridling Bettina Weiss 1 Counter/Timer Lecture Overview Counter Timer Prescaler Input Capture Output Compare PWM 2 important feature of microcontroller

More information

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes Purpose The intent of this course is to provide you with information about the main features of the S08 Timer/PWM (TPM) interface module and how to configure and use it in common applications. Objectives

More information

Select the single most appropriate response for each question.

Select the single most appropriate response for each question. ECE 362 Final Lab Practical - 1 - Practice Exam / Solution PART 1: Multiple Choice Select the single most appropriate response for each question. Note that none of the above MAY be a VALID ANSWER. (Solution

More information

EE 308 Spring 2006 FINAL PROJECT: INTERFACING AND MOTOR CONTROL WEEK 1 PORT EXPANSION FOR THE MC9S12

EE 308 Spring 2006 FINAL PROJECT: INTERFACING AND MOTOR CONTROL WEEK 1 PORT EXPANSION FOR THE MC9S12 FINAL PROJECT: INTERFACING AND MOTOR CONTROL In this sequence of labs you will learn how to interface with additional hardware and implement a motor speed control system. WEEK 1 PORT EXPANSION FOR THE

More information

Chapter 6 PROGRAMMING THE TIMERS

Chapter 6 PROGRAMMING THE TIMERS Chapter 6 PROGRAMMING THE TIMERS Force Outputs on Outcompare Input Captures Programmabl e Prescaling Prescaling Internal clock inputs Timer-counter Device Free Running Outcompares Lesson 2 Free Running

More information

Oct 30 Announcements. Bonus marked will be posted today Will provide 270 style feedback on multiple-choice questions. [3.E]-1

Oct 30 Announcements. Bonus marked will be posted today Will provide 270 style feedback on multiple-choice questions. [3.E]-1 Oct 30 Announcements Code Marked and on Blackboard This week: Mon 2:30 to 3:00pm, Tues 2:30 to 3:30 and W-F 1:30 to 3:00pm opportunity to talk about code: earn 2 extra points on the coding part Bonus marked

More information

CHAPTER III THE FPGA IMPLEMENTATION OF PULSE WIDTH MODULATION

CHAPTER III THE FPGA IMPLEMENTATION OF PULSE WIDTH MODULATION 34 CHAPTER III THE FPGA IMPLEMENTATION OF PULSE WIDTH MODULATION 3.1 Introduction A number of PWM schemes are used to obtain variable voltage and frequency supply. The Pulse width of PWM pulsevaries with

More information

Using the Z8 Encore! XP Timer

Using the Z8 Encore! XP Timer Application Note Using the Z8 Encore! XP Timer AN013104-1207 Abstract Zilog s Z8 Encore! XP microcontroller consists of four 16-bit reloadable timers that can be used for timing, event counting or for

More information

RV-8564 Application Manual. Application Manual. Real-Time Clock Module with I 2 C-Bus Interface. October /62 Rev. 2.1

RV-8564 Application Manual. Application Manual. Real-Time Clock Module with I 2 C-Bus Interface. October /62 Rev. 2.1 Application Manual Application Manual Real-Time Clock Module with I 2 C-Bus Interface October 2017 1/62 Rev. 2.1 TABLE OF CONTENTS 1. OVERVIEW... 5 1.1. GENERAL DESCRIPTION... 5 1.2. APPLICATIONS... 5

More information

ECE 4510/5530 Microcontroller Applications Midterm Review

ECE 4510/5530 Microcontroller Applications Midterm Review Microcontroller Applications Midterm Review Dr. Bradley J. Bazuin Associate Professor Department of Electrical and Computer Engineering College of Engineering and Applied Sciences Exam Composition HC12

More information

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232 PIC Functionality General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232 General I/O Logic Output light LEDs Trigger solenoids Transfer data Logic Input Monitor

More information

Lab 5 Timer Module PWM ReadMeFirst

Lab 5 Timer Module PWM ReadMeFirst Lab 5 Timer Module PWM ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) Interrupt Vector Table 3) Pin out Summary 4) DriverLib API 5) SineTable Overview In this lab, we are going to use the output hardware

More information

Topics Introduction to Microprocessors

Topics Introduction to Microprocessors Topics 2244 Introduction to Microprocessors Chapter 8253 Programmable Interval Timer/Counter Suree Pumrin,, Ph.D. Interfacing with 886/888 Programming Mode 2244 Introduction to Microprocessors 2 8253/54

More information

The Need. Reliable, repeatable, stable time base. Memory Access. Interval/Event timers ADC DAC

The Need. Reliable, repeatable, stable time base. Memory Access. Interval/Event timers ADC DAC Timers The Need Reliable, repeatable, stable time base Memory Access /Event timers ADC DAC Time Base: Crystal Oscillator Silicon Dioxide forms a piezoelectric crystal that can deform in eclectic field,

More information

MICROCONTROLLER TUTORIAL II TIMERS

MICROCONTROLLER TUTORIAL II TIMERS MICROCONTROLLER TUTORIAL II TIMERS WHAT IS A TIMER? We use timers every day - the simplest one can be found on your wrist A simple clock will time the seconds, minutes and hours elapsed in a given day

More information

Timer 0 Modes of Operation. Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode

Timer 0 Modes of Operation. Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode Timer 0 Modes of Operation Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode PWM - Introduction Recall: PWM = Pulse Width Modulation We will mostly use it for controlling

More information

EECS 270: Lab 7. Real-World Interfacing with an Ultrasonic Sensor and a Servo

EECS 270: Lab 7. Real-World Interfacing with an Ultrasonic Sensor and a Servo EECS 270: Lab 7 Real-World Interfacing with an Ultrasonic Sensor and a Servo 1. Overview The purpose of this lab is to learn how to design, develop, and implement a sequential digital circuit whose purpose

More information

Project Board Game Counter: Digital

Project Board Game Counter: Digital Project 1.3.3 Board Game Counter: Digital Introduction Just a few short weeks ago, most of you knew little or nothing about digital electronics. Now you are about to build and simulate a complete design.

More information

Microprocessor & Interfacing Lecture Programmable Interval Timer

Microprocessor & Interfacing Lecture Programmable Interval Timer Microprocessor & Interfacing Lecture 30 8254 Programmable Interval Timer P A R U L B A N S A L A S S T P R O F E S S O R E C S D E P A R T M E N T D R O N A C H A R Y A C O L L E G E O F E N G I N E E

More information

TKT-3500 Microcontroller systems

TKT-3500 Microcontroller systems TKT-3500 Microcontroller systems Lec 4 Timers and other peripherals, pulse-width modulation Ville Kaseva Department of Computer Systems Tampere University of Technology Fall 2010 Sources Original slides

More information

Chapter 5 Timer Functions ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 5.1 The Timer System 5.2 Programming the Timer System 5.3 Examples and Applications The

More information

Exercise 3: Sound volume robot

Exercise 3: Sound volume robot ETH Course 40-048-00L: Electronics for Physicists II (Digital) 1: Setup uc tools, introduction : Solder SMD Arduino Nano board 3: Build application around ATmega38P 4: Design your own PCB schematic 5:

More information

Grundlagen Microcontroller Analog I/O. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Analog I/O. Günther Gridling Bettina Weiss Grundlagen Microcontroller Analog I/O Günther Gridling Bettina Weiss 1 Analog I/O Lecture Overview A/D Conversion Design Issues Representation Conversion Techniques ADCs in Microcontrollers Analog Comparators

More information

CS/ECE 6780/5780. Al Davis. Today s topics: Output capture Pulse Width Modulation Pulse Accumulation all useful options for Lab7 1 CS 5780

CS/ECE 6780/5780. Al Davis. Today s topics: Output capture Pulse Width Modulation Pulse Accumulation all useful options for Lab7 1 CS 5780 CS/ECE 6780/5780 Al Davis Today s topics: Output capture Pulse Width Modulation Pulse Accumulation all useful options for Lab7 1 CS 5780 Output Compare Basic output control create square waves» including

More information

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ υιοπασδφγηϕκλζξχϖβνµθωερτψυιοπασδ φγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκλζ ξχϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµ EE 331 Design Project Final Report θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ

More information

EXAMINATION PAPER EMBEDDED SYSTEMS 6EJ005 UNIVERSITY OF DERBY. School of Computing and Technology DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS

EXAMINATION PAPER EMBEDDED SYSTEMS 6EJ005 UNIVERSITY OF DERBY. School of Computing and Technology DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS BSc/BSc (HONS) MUSIC TECHNOLOGY AND AUDIO SYSTEM DESIGN BSc/BSc (HONS) LIVE PERFORMANCE TECHNOLOGY BSc/BSc (HONS) ELECTRICAL AND ELECTRONIC ENGINEERING DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS Instructions

More information

EE 314 Spring 2003 Microprocessor Systems

EE 314 Spring 2003 Microprocessor Systems EE 314 Spring 2003 Microprocessor Systems Laboratory Project #9 Closed Loop Control Overview and Introduction This project will bring together several pieces of software and draw on knowledge gained in

More information

HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM

HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM RAM Mapping 48 16 LCD Controller for I/O µc LCD Controller Product Line Selection Table HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM 4 4 8 8 8 81 16 16 16 SEG 32 32 32 32

More information

ATmega16A Microcontroller

ATmega16A Microcontroller ATmega16A Microcontroller Timers 1 Timers Timer 0,1,2 8 bits or 16 bits Clock sources: Internal clock, Internal clock with prescaler, External clock (timer 2), Special input pin 2 Features The choice of

More information

HW D2: Sequential Logic, Counters, Debounce

HW D2: Sequential Logic, Counters, Debounce HW D2: Sequential Logic, Counters, Debounce 1 HW D2: Sequential Logic, Counters, Debounce REV 3; July 18, 2010 Contents 1 Flop Reminder: edge recorder (2 points) 1 2 Debouncers (4 points) 2 2.1 SPST (2

More information

ECE251: Tuesday October 3 0

ECE251: Tuesday October 3 0 ECE251: Tuesday October 3 0 Timer Module Continued Review Pulse Input Characterization Output Pulses Pulse Count Capture Homework #6 due Thursday Lab 7 (Maskable Interrupts/ SysTick Timer) this week. Significant

More information

ELCT 912: Advanced Embedded Systems

ELCT 912: Advanced Embedded Systems ELCT 912: Advanced Embedded Systems Lecture 5: PIC Peripherals on Chip Dr. Mohamed Abd El Ghany, Department of Electronics and Electrical Engineering The PIC Family: Peripherals Different PICs have different

More information

Switch/ Jumper Table 1-1: Factory Settings Factory Settings (Jumpers Installed) Function Controlled Activates pull-up/ pull-down resistors on Port 0 digital P7 I/O lines Activates pull-up/ pull-down resistors

More information

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION Microcomputer system design requires

More information

Using the HT66F016L and the HT66F50 to Implement Remote Encoding and Decoding

Using the HT66F016L and the HT66F50 to Implement Remote Encoding and Decoding Using the HT66F016L and the HT66F50 to Implement Remote Encoding and Decoding D/N:AN0327E Introduction This application note describes how to implement a 4 3 Key NEC remote encoding Demo Board using the

More information

Microcontroller: Timers, ADC

Microcontroller: Timers, ADC Microcontroller: Timers, ADC Amarjeet Singh February 1, 2013 Logistics Please share the JTAG and USB cables for your assignment Lecture tomorrow by Nipun 2 Revision from last class When servicing an interrupt,

More information

EE 308 Lab Spring 2009

EE 308 Lab Spring 2009 9S12 Subsystems: Pulse Width Modulation, A/D Converter, and Synchronous Serial Interface In this sequence of three labs you will learn to use three of the MC9S12's hardware subsystems. WEEK 1 Pulse Width

More information

Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its

Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its main features and the application benefits of leveraging

More information

1 Contents 2 2 Overview 3 3 Hardware Interface 4 4 Software Interface Register Map Interrupts 7

1 Contents 2 2 Overview 3 3 Hardware Interface 4 4 Software Interface Register Map Interrupts 7 1 Contents 1 Contents 2 2 Overview 3 3 Hardware Interface 4 4 Software Interface 5 4.1 Register Map 5 4.2 Interrupts 7 Version 2.2 - Confidential 2 of 7 2010 EnSilica Ltd, All Rights Reserved 2 Overview

More information

EE251: Thursday October 25

EE251: Thursday October 25 EE251: Thursday October 25 Review SysTick (if needed) General-Purpose Timers A Major Topic in ECE251 An entire section (11) of the TM4C Data Sheet Basis for Lab #8, starting week after next Homework #5

More information

Design of double loop-locked system for brush-less DC motor based on DSP

Design of double loop-locked system for brush-less DC motor based on DSP International Conference on Advanced Electronic Science and Technology (AEST 2016) Design of double loop-locked system for brush-less DC motor based on DSP Yunhong Zheng 1, a 2, Ziqiang Hua and Li Ma 3

More information

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function LCD DRIVER The IZ602 is universal LCD controller designed to drive LCD with image element up to 128 (32x4). Instruction set makes IZ602 universal and suitable for applications with different types of displays.

More information

Lecture 12 Timer Functions

Lecture 12 Timer Functions CPE 390: Microprocessor Systems Spring 2018 Lecture 12 Timer Functions Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 Adapted from HCS12/9S12

More information

EE445L Fall 2011 Quiz 2A Page 1 of 6

EE445L Fall 2011 Quiz 2A Page 1 of 6 EE445L Fall 2011 Quiz 2A Page 1 of 6 Jonathan W. Valvano First: Last: November 18, 2011, 2:00pm-2:50pm. Open book, open notes, calculator (no laptops, phones, devices with screens larger than a TI-89 calculator,

More information

MM58174A Microprocessor-Compatible Real-Time Clock

MM58174A Microprocessor-Compatible Real-Time Clock MM58174A Microprocessor-Compatible Real-Time Clock General Description The MM58174A is a low-threshold metal-gate CMOS circuit that functions as a real-time clock and calendar in bus-oriented microprocessor

More information

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES Faculty of Engineering INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES Lab 1 Prepared by Kevin Premrl & Pavel Shering ID # 20517153 20523043 3a Mechatronics Engineering June 8, 2016 1 Phase

More information

The SOL-20 Computer s Cassette interface.

The SOL-20 Computer s Cassette interface. The SOL-20 Computer s Cassette interface. ( H. Holden. Dec. 2018 ) Introduction: The Cassette interface designed by Processor Technology (PT) for their SOL-20 was made to be compatible with the Kansas

More information

MICROPROCESSORS A (17.383) Fall Lecture Outline

MICROPROCESSORS A (17.383) Fall Lecture Outline MICROPROCESSORS A (17.383) Fall 2010 Lecture Outline Class # 07 October 26, 2010 Dohn Bowden 1 Today s Lecture Syllabus review Microcontroller Hardware and/or Interface Finish Analog to Digital Conversion

More information

LSI/CSI LS7290 STEPPER MOTOR CONTROLLER. LSI Computer Systems, Inc Walt Whitman Road, Melville, NY (631) FAX (631)

LSI/CSI LS7290 STEPPER MOTOR CONTROLLER. LSI Computer Systems, Inc Walt Whitman Road, Melville, NY (631) FAX (631) LSI/CSI UL A800 FEATURES: LSI Computer Systems, Inc. 1 Walt Whitman Road, Melville, NY 114 (1) 1-0400 FAX (1) 1-040 STEPPER MOTOR CONTROLLER Controls Bipolar and Unipolar Motors Cost-effective replacement

More information

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by A MORON'S GUIDE TO TIMER/COUNTERS v2.2 by RetroDan@GMail.com TABLE OF CONTENTS: 1. THE PAUSE ROUTINE 2. WAIT-FOR-TIMER "NORMAL" MODE 3. WAIT-FOR-TIMER "NORMAL" MODE (Modified) 4. THE TIMER-COMPARE METHOD

More information

Chapter 7: Systems for Frequency Generation

Chapter 7: Systems for Frequency Generation Chapter 7: Systems for Frequency Generation Chapter 7 Objectives t the conclusion of this chapter, the reader will be able to: List the components in a Phase Locked Loop, explaining the purpose of each

More information

Written by Hans Summers Wednesday, 15 November :53 - Last Updated Wednesday, 15 November :07

Written by Hans Summers Wednesday, 15 November :53 - Last Updated Wednesday, 15 November :07 This is a phantastron divider based on the HP522 frequency counter circuit diagram. The input is a 2100Hz 15V peak-peak signal from my 2.1kHz oscillator project. Please take a look at the crystal oscillator

More information

DAC A (VCO) Buffer (write) DAC B (AGC) Buffer (write) Pulse Code Buffer (write) Parameter Buffer (write) Figure A.1. Receiver Controller Registers

DAC A (VCO) Buffer (write) DAC B (AGC) Buffer (write) Pulse Code Buffer (write) Parameter Buffer (write) Figure A.1. Receiver Controller Registers Appendix A. Host Computer Interface The host computer interface is contained on a plug-in module designed for the IBM PC/XT/AT bus. It includes the converters, counters, registers and programmed-logic

More information

Measuring Distance Using Sound

Measuring Distance Using Sound Measuring Distance Using Sound Distance can be measured in various ways: directly, using a ruler or measuring tape, or indirectly, using radio or sound waves. The indirect method measures another variable

More information

Interfacing Sensors & Modules to Microcontrollers

Interfacing Sensors & Modules to Microcontrollers Interfacing Sensors & Modules to Microcontrollers Presentation Topics I. Microprocessors & Microcontroller II. III. Hardware/software Tools for Interfacing Type of Sensors/Modules IV. Level Inputs (Digital

More information

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM RAM Mapping 328 LCD Controller for I/O C Features Operating voltage: 2.7V~5.2V Built-in RC oscillator 1/4 bias, 1/8 duty, frame frequency is 64Hz Max. 328 patterns, 8 commons, 32 segments Built-in internal

More information

MCU Reset and Oscillator Circuits Application Note

MCU Reset and Oscillator Circuits Application Note MCU Reset and Oscillator Circuits Application Note D/N: HA0075E System Oscillator Crystal/Ceramic Oscillator Crystal/Ceramic Oscillator Equivalent Circuit The following circuit combination of resistors,

More information

A Programmable Clock Generator Based on Xilinx CoolRunner

A Programmable Clock Generator Based on Xilinx CoolRunner A Programmable Clock Generator Based on Xilinx CoolRunner Gunther Zielosko, Heiko Grimm 1. Objectives As presented in our previous application note we would like to develop applications for BASIC-Tiger

More information

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM RAM Mapping 328 LCD Controller for I/O MCU PATENTED PAT No. : 099352 Technical Document Application Note Features Operating voltage: 2.7V~5.2V Built-in RC oscillator 1/4 bias, 1/8 duty, frame frequency

More information

I2C Encoder. HW v1.2

I2C Encoder. HW v1.2 I2C Encoder HW v1.2 Revision History Revision Date Author(s) Description 1.0 22.11.17 Simone Initial version 1 Contents 1 Device Overview 3 1.1 Electrical characteristics..........................................

More information

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU Application Note Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU AN026002-0608 Abstract This application note describes a controller for a 200 W, 24 V Brushless DC (BLDC) motor used to power

More information

Input/Output Control Using Interrupt Service Routines to Establish a Time base

Input/Output Control Using Interrupt Service Routines to Establish a Time base CSUS EEE174 Lab Input/Output Control Using Interrupt Service Routines to Establish a Time base 599 Menlo Drive, Suite 100 Rocklin, California 95765, USA Office/Tech Support: (916) 624-8333 Fax: (916) 624-8003

More information

S3C9442/C9444/F9444/C9452/C9454/F9454

S3C9442/C9444/F9444/C9452/C9454/F9454 PRODUCT OVERVIEW 1 PRODUCT OVERVIEW SAM88RCRI PRODUCT FAMILY Samsung's SAM88RCRI family of 8-bit single-chip CMOS microcontrollers offers a fast and efficient CPU, a wide range of integrated peripherals,

More information

Application Note. Introduction. AN2219/D Rev. 0, 12/2001. Using PLL to Indicate Oscillator Start-Up Performance during Power On Reset

Application Note. Introduction. AN2219/D Rev. 0, 12/2001. Using PLL to Indicate Oscillator Start-Up Performance during Power On Reset Application Note Rev. 0, 12/2001 Using PLL to Indicate Oscillator Start-Up Performance during Power On Reset By Gordon Borland Applications Engineering Freescale, East Kilbride Introduction Customers have

More information

HT1621. HT1621 RAM Mapping 32x4 LCD Controller for I/O MCU

HT1621. HT1621 RAM Mapping 32x4 LCD Controller for I/O MCU HT1621 RAM Mapping 32x4 LCD Controller for I/O MCU Features Operating voltage: 2.4V ~ 5.2V Built-in 256kHz RC oscillator External 32.768kHz crystal or 256 khz frequency source input Selection of 1/2 or

More information

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno Microcontrollers: Lecture 3 Interrupts, Timers Michele Magno 1 Calendar 07.04.2017: Power consumption; Low power States; Buses, Memory, GPIOs 20.04.2017 Serial Communications 21.04.2017 Programming STM32

More information

Laboratory Exercise 1 Microcontroller Board with Driver Board

Laboratory Exercise 1 Microcontroller Board with Driver Board Laboratory Exercise 1 Microcontroller Board with Driver Board The purpose of this lab exercises is to demonstrate how the Microcontroller Board can be used to control motors connected to the Driver Board

More information

Block Diagram , E I F = O 4 ) + J H 6 E E C + E H? K E J +,, H E L A H * E = I + E H? K E J + + % 8,, % 8 +, * * 6 A. H A G K A? O

Block Diagram , E I F = O 4 ) + J H 6 E E C + E H? K E J +,, H E L A H * E = I + E H? K E J + + % 8,, % 8 +, * * 6 A. H A G K A? O PAT No. : 099352 RAM Mapping 488 LCD Controller for I/O MCU Technical Document Application Note Features Operating voltage: 2.7V~5.2V Built-in LCD display RAM Built-in RC oscillator R/W address auto increment

More information

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

I hope you have completed Part 2 of the Experiment and is ready for Part 3. I hope you have completed Part 2 of the Experiment and is ready for Part 3. In part 3, you are going to use the FPGA to interface with the external world through a DAC and a ADC on the add-on card. You

More information

XGATE Library: PWM Driver Generating flexible PWM signals on GPIO pins

XGATE Library: PWM Driver Generating flexible PWM signals on GPIO pins Freescale Semiconductor Application Note AN3225 Rev. 0, 2/2006 XGATE Library: PWM Driver Generating flexible PWM signals on GPIO pins by: Armin Winter, Field Applications, Wiesbaden Daniel Malik, MCD Applications,

More information

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System Introduction CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System The purpose of this lab is to introduce you to digital control systems. The most basic function of a control system is to

More information

Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some

Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some application examples. 1 The two comparators inside STM32 microcontroller

More information

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE 9S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE In this sequence of three labs you will learn to use the 9S12 S hardware sybsystem. WEEK 1 PULSE WIDTH MODULATION

More information

Castle Creations, INC.

Castle Creations, INC. Castle Link Live Communication Protocol Castle Creations, INC. 6-Feb-2012 Version 2.0 Subject to change at any time without notice or warning. Castle Link Live Communication Protocol - Page 1 1) Standard

More information

STELLARIS ERRATA. Stellaris LM3S8962 RevA2 Errata

STELLARIS ERRATA. Stellaris LM3S8962 RevA2 Errata STELLARIS ERRATA Stellaris LM3S8962 RevA2 Errata This document contains known errata at the time of publication for the Stellaris LM3S8962 microcontroller. The table below summarizes the errata and lists

More information

Built-in LCD display RAM Built-in RC oscillator

Built-in LCD display RAM Built-in RC oscillator PAT No. : TW 099352 RAM Mapping 488 LCD Controller for I/O MCU Technical Document Application Note Features Operating voltage: 2.7V~5.2V Built-in LCD display RAM Built-in RC oscillator R/W address auto

More information

R/W address auto increment External Crystal kHz oscillator

R/W address auto increment External Crystal kHz oscillator RAM Mapping 328 LCD Controller for I/O MCU PATENTED PAT No. : 099352 Features Operating voltage: 2.7V~5.2V R/W address auto increment External Crystal 32.768kHz oscillator Two selectable buzzer frequencies

More information

EE 308 Spring 2013 The MC9S12 Pulse Width Modulation System

EE 308 Spring 2013 The MC9S12 Pulse Width Modulation System The MC9S12 Pulse Width Modulation System o Introduction to PWM o Review of the Output Compare Function o Using Output Compare to generate a PWM signal o Registers used to enable the Output Capture Function

More information

Houngninou 2. Abstract

Houngninou 2. Abstract Houngninou 2 Abstract The project consists of designing and building a system that monitors the phase of two pulses A and B. Three colored LEDs are used to identify the phase comparison. When the rising

More information

PWMLib PWM Library. Jim Schimpf. Document Number: PAN Revision Number: April Pandora Products. 215 Uschak Road Derry, PA 15627

PWMLib PWM Library. Jim Schimpf. Document Number: PAN Revision Number: April Pandora Products. 215 Uschak Road Derry, PA 15627 PWMLib Jim Schimpf Document Number: Revision Number: 0.8 Pandora Products. 215 Uschak Road Derry, PA 15627 Creative Commons Attribution 4.0 International License 2015 Pandora Products. All other product

More information

DASL 120 Introduction to Microcontrollers

DASL 120 Introduction to Microcontrollers DASL 120 Introduction to Microcontrollers Lecture 2 Introduction to 8-bit Microcontrollers Introduction to 8-bit Microcontrollers Introduction to 8-bit Microcontrollers Introduction to Atmel Atmega328

More information

8253 functions ( General overview )

8253 functions ( General overview ) What are these? The Intel 8253 and 8254 are Programmable Interval Timers (PITs), which perform timing and counting functions. They are found in all IBM PC compatibles. 82C54 which is a superset of the

More information

Design and Construction of PIC-based IR Remote Control Moving Robot

Design and Construction of PIC-based IR Remote Control Moving Robot Design and Construction of PIC-based IR Remote Control Moving Robot Sanda Win, Tin Shein, Khin Maung Latt Abstract This document describes an electronic speed control designed to drive two DC motors from

More information

HD44102D. (Dot Matrix Liquid Crystal Graphic Display Column Driver) Features. Description. Ordering Information

HD44102D. (Dot Matrix Liquid Crystal Graphic Display Column Driver) Features. Description. Ordering Information HD442 (Dot Matrix Liquid Crystal Graphic Display Column Driver) Description The HD442 is a column (segment) driver for dot matrix liquid crystal graphic display systems, storing the display data transferred

More information

PCF2129 Integrated RTC/TCXO/Crystal

PCF2129 Integrated RTC/TCXO/Crystal Rev..1 29 August 28 T D Objective data sheet 1. General description 2. Features T A The is a CMOS real time clock and calendar with an integrated temperature compensated crystal oscillator (TCXO) and a

More information

Programming and Interfacing

Programming and Interfacing AtmelAVR Microcontroller Primer: Programming and Interfacing Second Edition f^r**t>*-**n*c contents Preface xv AtmelAVRArchitecture Overview 1 1.1 ATmegal64 Architecture Overview 1 1.1.1 Reduced Instruction

More information

CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 8: I/O INTERFACING QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS

CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 8: I/O INTERFACING QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 8: I/O INTERFACING QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS Q1. Distinguish between vectored and non-vectored interrupts

More information

PATENTED. PAT No. : HT1622/HT1622G RAM Mapping 32 8 LCD Controller for I/O MCU. Features. General Description.

PATENTED. PAT No. : HT1622/HT1622G RAM Mapping 32 8 LCD Controller for I/O MCU. Features. General Description. RAM Mapping 328 LCD Controller for I/O MCU PATENTED PAT No. : 099352 Features Operating voltage: 2.7V~5.2V Built-in RC oscillator 1/4 bias, 1/8 duty, frame frequency is 64Hz Max. 328 patterns, 8 commons,

More information

ZKit-51-RD2, 8051 Development Kit

ZKit-51-RD2, 8051 Development Kit ZKit-51-RD2, 8051 Development Kit User Manual 1.1, June 2011 This work is licensed under the Creative Commons Attribution-Share Alike 2.5 India License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/in/

More information

ENGR-2300 Electronic Instrumentation Quiz 3 Spring Name: Solution Please write you name on each page. Section: 1 or 2

ENGR-2300 Electronic Instrumentation Quiz 3 Spring Name: Solution Please write you name on each page. Section: 1 or 2 ENGR-2300 Electronic Instrumentation Quiz 3 Spring 2018 Name: Solution Please write you name on each page Section: 1 or 2 4 Questions Sets, 20 Points Each LMS Portion, 20 Points Question Set 1) Question

More information

First Optional Homework Problem Set for Engineering 1630, Fall 2014

First Optional Homework Problem Set for Engineering 1630, Fall 2014 First Optional Homework Problem Set for Engineering 1630, Fall 014 1. Using a K-map, minimize the expression: OUT CD CD CD CD CD CD How many non-essential primes are there in the K-map? How many included

More information

DTMF receiver for telephones

DTMF receiver for telephones DTMF receiver for telephones The BU8874 and BU8874F are DTMF receiver ICs developed for use in telephone answering machines, and convert 16 different types of DTMF signals into 4-bit binary serial data.

More information

logic system Outputs The addition of feedback means that the state of the circuit may change with time; it is sequential. logic system Outputs

logic system Outputs The addition of feedback means that the state of the circuit may change with time; it is sequential. logic system Outputs Sequential Logic The combinational logic circuits we ve looked at so far, whether they be simple gates or more complex circuits have clearly separated inputs and outputs. A change in the input produces

More information

Graphical Control Panel User Manual

Graphical Control Panel User Manual Graphical Control Panel User Manual DS-MPE-DAQ0804 PCIe Minicard Data Acquisition Module For Universal Driver Version 7.0.0 and later Revision A.0 March 2015 Revision Date Comment A.0 3/18/2015 Initial

More information