Microprocessor Fundamentals. Topic 7 Timing: the Timer/Counter
|
|
- Kristopher Wilson
- 6 years ago
- Views:
Transcription
1 Microprocessor Fundamentals Topic 7 Timing: the Timer/Counter
2 Objectives Examine the Timer/Counter Register: TCNT0 Examine the Timer/Counter Control Register: TCCR0 Write a time delay for the previous program example: Light Chaser Use the Timer/Counter Design a ½ sec. delay for lights on/off Assume a 16 MHz clock 2/23/2012 2
3 Timer/Counter So, we have: The Light Chaser Program Must add a time delay for the program: Use the Timer/Counter Design a ½ sec. delay for lights on/off Assume a 16 MHz clock We need to look up the Timer/Counter 2/23/2012 3
4 Timer/Counter Open the ATmega128 Manual Click on the 8-Bit Timer/Counter 0 2/23/2012 4
5 Timer/Counter 8-Bit Timer/Counter Click on the 8-Bit Timer/Counter Registers 2/23/2012 5
6 TCCR0 The Timer/Counter Control Register We are most concerned with bits 2, 1, and 0. They control the clock source to be used by the counter 2/23/2012 6
7 TCCR0 The Timer/Counter Control Register We are most concerned with bits 2, 1, and 0. They control the clock source to be used by the counter We can turn off the counter We can use the system clock or We can use a slower signal based on the system clock 2/23/2012 7
8 TCCR0 The Timer/Counter Control Register We are initializing the Timer/Counter so that it will increment at every clock pulse. If the system clock was 10 MHz: If we used the system clock, the Timer/Counter would increment every 100ns 2/23/2012 8
9 TCCR0 The Timer/Counter Control Register We are initializing the Timer/Counter so that it will increment at every clock pulse. If the system clock was 10 MHz: If we used the system clock, the Timer/Counter would increment every 100ns If we used a prescaler of 1024 (bits 2-0 = 111), the Timer/Counter would increment every 100 us 2/23/2012 9
10 TCCR0 The Timer/Counter Control Register The real question: How long must our delay be? The Timer/Counter (an 8-bit register) can count from 0 to 255. With a 10 MHz clock and no prescaler, the Timer/Counter can count from 1 to 255 in 100ns to 25.5 us With a 1024 prescaler, it could count from 1 to 255 in 100us to 25.5 ms 2/23/
11 TCCR0 The Timer/Counter Control Register If we need a delay of 10 us, don t use a prescaler. The real question: How long must our delay be? The Timer/Counter (an 8-bit register) can count from 0 to 255. With a 10 MHz clock and no prescaler, the Timer/Counter can count from 1 to 255 in 100ns to 25.5 us With a 1024 prescaler, it could count from 1 to 255 in 100us to 25.5 ms 2/23/
12 TCCR0 The Timer/Counter Control Register If we need a delay of 10 us, don t use a prescaler. If we need a delay of 10ms, use the 1024 prescaler The real question: How long must our delay be? The Timer/Counter (an 8-bit register) can count from 0 to 255. With a 10 MHz clock and no prescaler, the Timer/Counter can count from 1 to 255 in 100ns to 25.5 us With a 1024 prescaler, it could count from 1 to 255 in 100us to 25.5 ms 2/23/
13 Example: Write the initialization routine and the timing loop to form a delay of 10ms (assume a 10 MHz clock) 2/23/
14 Example: Write the initialization routine and the timing loop to form a delay of 10ms (assume a 10 MHz clock) A 10 MHz clock will take 100ns/cycle A 1024 prescaler means we will increment the TC every 100us To count from 0 to 10 ms and incrementing TC every 100 us/count means we have to count from 0 to 10ms/100us 1 = = = 63 X We subtract 1 because we are counting from 0, not 1 2/23/
15 Example: Write the initialization routine and the timing loop to form a delay of 10ms (assume a 10 MHz clock) ;========================================================.def delayreg = r17.def TCValue = r18 ;name registers ;=========================== Init: ldi delayreg,0x07 ;set initial parameters for counter out TCCR0,delayReg ;prescaler = 1024 (ATmega128) ;============================ TDelay: ldi delayreg,0 ;initialize timer/counter 0 out TCNT0,delayReg Here s the program. I used a prescaler of 1024 to reduce the counter s clock from 10 MHz to 10 khz (111 in bits 2, 1, 0) TLoop: in TCValue,TCNT0 ; read timer/counter value cpi TCValue,0x63 ; is it $63? brne Tloop ; if not $63, read it again (until $63) done ;================================= 2/23/
16 Example: Write the initialization routine and the timing loop to form a delay of 10ms (assume a 10 MHz clock) ;========================================================.def delayreg = r17.def TCValue = r18 ;name registers ;=========================== Init: ldi delayreg,0x07 ;set initial parameters for counter out TCCR0,delayReg ;prescaler = 1024 (ATmega128) ;============================ TDelay: ldi delayreg,0 ;initialize timer/counter 0 out TCNT0,delayReg TLoop: in TCValue,TCNT0 ; read timer/counter value cpi TCValue,0x63 ; is it $63? brne Tloop ; if not $63, read it again (until $63) Here s the program. I used a prescaler of 1024 to reduce the counter s clock from 10 MHz to 10 khz (111 in bits 2, 1, 0) Then load the TC with 0 to initialize the count (it starts on its own) done ;================================= 2/23/
17 Example: Write the initialization routine and the timing loop to form a delay of 10ms (assume a 10 MHz clock) ;========================================================.def delayreg = r17.def TCValue = r18 ;name registers ;=========================== Init: ldi delayreg,0x07 ;set initial parameters for counter out TCCR0,delayReg ;prescaler = 1024 (ATmega128) ;============================ TDelay: ldi delayreg,0 ;initialize timer/counter 0 out TCNT0,delayReg TLoop: in TCValue,TCNT0 ; read timer/counter value cpi TCValue,0x63 ; is it $63? brne Tloop ; if not $63, read it again (until $63) done ;================================= Here s the program. I used a prescaler of 1024 to reduce the counter s clock from 10 MHz to 10 khz (111 in bits 2, 1, 0) Then load the TC with 0 to initialize the count (it starts on its own) Then we continuously read the TC (TCNT0) until its value is decimal 99 (or hex 63) if it does not have 63 in it yet, go back and read it again 2/23/
18 Exercise: Write the initialization routine and the timing loop to form a delay of 15ms (assume a 16 MHz clock) 2/23/
19 A Solution: Write the initialization routine and the timing loop to form a delay of 15ms (assume a 16 MHz clock) ;========================================================.def delayreg = r17.def TCValue = r18 ;name registers ;=========================== Init: ldi delayreg,0x07 ;set initial parameters for counter out TCCR0,delayReg ;prescaler = 1024 (ATmega128) ;============================ TDelay: ldi delayreg,0 ;initialize timer/counter 0 out TCNT0,delayReg TLoop: in TCValue,TCNT0 ; read timer/counter value cpi TCValue,0xEF ; is it $EF? brne Tloop ; if not $63, read it again (until $EF) done ;================================= Here s the program. I used a prescaler of 1024 again - to reduce the counter s clock from 16 MHz to 16 khz (111 in bits 2, 1, 0) Then load the TC with 0 to initialize the count (it starts on its own) Then we continuously read the TC (TCNT0) until its value is decimal 239 (or hex EF) if it does not have EF in it yet, go back and read it again 2/23/
20 Longer Delays: What if we need a longer delay? Example: ½ sec (500ms) or 1 sec (1000ms) If we assume a 10 MHz clock, the prescaler will help us get down to 10 khz Timer/Counter increments every 100 us Timer/Counter must count to: 5,000 for ½ sec 10,000 for 1 sec 2/23/
21 Longer Delays: What if we need a longer delay? Example: ½ sec (500ms) or 1 sec (1000ms) If we assume a 10 MHz clock, the prescaler will help us get down to 10 khz Timer/Counter increments every 100 us Timer/Counter must count to: 5,000 for ½ sec 10,000 for 1 sec 8 bit counters can only count to 255 2/23/
22 Longer Delays: To count to ½ sec (500ms) or 1 sec (1000ms): We need a nested loop Execute the delay loop more than once For example: Assume a 10 MHz clock, a prescaler of 1024, and a count in the Timer/Counter to 255 (0 to 255 is a count of 256) The TC increments every 100 us Once through the delay loop is 25.6 ms For a ½ sec delay, we would need to execute the delay loop 500ms/25.6ms = 19.5 times (19 or 20 whichever is closer) For a 1 sec delay: 1000ms/25.6ms = 39 times 2/23/
23 Longer Delays: Now, let s add the longer delay to the Light Chaser program. 2/23/
24 Enter Program Original Program Statements New registers Timer/Counter Initialization Delay Instructions inserted to remove the blank caused by the C bit (see previous topic) ;======================================================== : documentation ;=========================== ; Declarations.device ATmega128.def lights = r16 ;name registers.def delayreg = r17.def counter = r18.def CntValue = r19 ;=========================== Init: ldi lights,0b ;setup inputs and outputs for PortB out DDRB,lights ldi lights,0b ;set initial values for outputs out PortB,lights ldi delayreg,0x07 ;set initial parameters for counter out TCCR0,delayReg ;prescaler = 1024 (ATmega128) ;============================ ;Start Program Start: cpi lights,0 brne Next ldi lights,0b ;reset values for outputs Next: out PortB,lights ; sends data to Port B (1 lights LED) ror lights ; rotate bits once to the left ;================================= ;Time Delay TDelay: ldi counter,31 ;set initial # of times through delay loop ; 32 =.5 sec (64 = 1s) TLoop2: ldi delayreg,0 ;initialize timer/counter 0 out TCNT0,delayReg TLoop: in CntValue,TCNT0 ; read timer/counter value cpi CntValue,255 ; is it 0? brne TLoop ; if not 0, read it again (until 0) dec counter ; counting down to 0 for.5 sec brne TLoop2 rjmp Start 2/23/
25 Lights Now the LEDs should appear as shown when we download this to the AVR board: and then repeat 2/23/
26 Development Process If we have followed the development process, we have: Gathered and verified the requirements Laid out the plan (flowcharted) Chosen the target processor Written the program Assembled the program Now we have to simulate, but we have a new problem 2/23/
27 Development Process If we single step through the program as before, it will take a long time to go through the delays Fortunately, we have other options Set break points Run the program Let s start with the simplest: We get to the instruction 2/23/
28 Simulation Open AVR Studio, Assemble the program Best place to set a breakpoint is after the delay loop has finished executing 2/23/
29 Simulation Open AVR Studio, Assemble the program Best place to set a breakpoint is after the delay loop has finished executing To set the breakpoint: place the cursor at the command and click on the hand: 2/23/
30 Simulation Open AVR Studio, Assemble the program Best place to set a breakpoint is after the delay loop has finished executing To set the breakpoint: place the cursor at the command and click on the hand: 2/23/
31 Simulation To start debugging, click Debug on the Debug Menu or click on the (Hidden by menu) 2/23/
32 Simulation To start, click on the Run button 2/23/
33 Simulation To simulation will run to the breakpoint and stop All affected registers will be updated 2/23/
34 Simulation This will show us r18 (counter) counting down (it will take awhile) Reset the program and change the breakpoint to the rjmp instruction 2/23/
35 Simulation Each time you hit the Run button, you ll see the I/O registers get updated Now we should download it to the board and test it 2/23/
36 Summary We: Examined the Timer/Counter Register: TCNT0 Examined the Timer/Counter Control Register: TCCR0 Wrote a time delay for the previous program example: Light Chaser Used the Timer/Counter Designed a ½ sec. delay for lights on/off 2/23/
Microprocessor Fundamentals. Topic 8 Binary Addition
Microprocessor Fundamentals Topic 8 Binary Addition Objectives Examine several assembler directives:.dseg /.eseg /.cseg.db.byte Use indirect addressing X register (r26 and r27) Post-increment Store results
More informationEmbedded Systems and Software
Embedded Systems and Software Timers and Counters F-35 Lightning II Electro-optical Targeting System (EOTS Lecture 1, Slide-1 Timers and Counters Very important peripherals on microcontrollers ATtiny45
More informationIntroduction to Assembly language
Introduction to Assembly language 1 USING THE AVR MICROPROCESSOR Outline Introduction to Assembly Code The AVR Microprocessor Binary/Hex Numbers Breaking down an example microprocessor program AVR instructions
More informationMicroprocessors & Interfacing
Lecture Overview Microprocessors & Interfacing Interrupts (II) Interrupts in AVR External interrupts Internal interrupts Timers/Counters Lecturer : Dr. Annie Guo S2, 2008 COMP9032 Week7 1 S2, 2008 COMP9032
More informationInterrupts (II) Lecturer: Sri Parameswaran Notes by: Annie Guo
Interrupts (II) Lecturer: Sri Parameswaran Notes by: Annie Guo 1 External Interrupts The external interrupts are triggered by the INT7:0 pins. If enabled, the interrupts will trigger even if the INT7:0
More informationLab 2: Basic Assembly Programming and Debugging using AVR Studio. Due: December 13, 2011
Lab 2: Basic Assembly Programming and Debugging using AVR Studio 1 Outcomes Due: December 13, 2011 Familiarize yourself with the capabilities of the ATMEGA32 embedded microcontroller and AVR Studio Develop
More informationBASIC AVR ARITHMATIC v1.1 ADDITION and SUBTRACTION by
BASIC AVR ARITHMATIC v1.1 ADDITION and SUBTRACTION by RetroDan@GMail.Com CONTENTS: 1. ADDING AND SUBTRACTING ONE FROM A REGISTER 2. LOADING A REGISTER WITH A CONSTANT 3. ADDING AND SUBTRACTING A CONSTANT
More informationCOMP2121: Microprocessors and Interfacing
Lecture 19: Interrupts II http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 1, 2006 Overview AVR Interrupts Interrupt Vector Table System Reset Watchdog Timer Timer/Counter0 Interrupt Service
More informationEE 308: Microcontrollers
EE 308: Microcontrollers Timers Aly El-Osery Electrical Engineering Department New Mexico Institute of Mining and Technology Socorro, New Mexico, USA April 2, 2018 Aly El-Osery (NMT) EE 308: Microcontrollers
More informationCOMP2121 Introductory Experiment
COMP2121 Introductory Experiment Objectives: In this introductory experiment, you will: Learn how to use AVR studio, an Integrated Development Environment (IDE) for developing AVR applications in Windows
More informationTimers and Interrupts. Mark Neil - Microprocessor Course
Timers and Interrupts 1 Example Product: Signal Generator A Signal Generator should be programmable. A user can use the the LCD display and the keyboard to change the: Frequency scale Amplitude scale Offset
More informationLab Objectives. 2. Preparations. 3. Signing in. 4. Examining the Host Environment. 5. Part A: Introduction to AVR Studio. 5.
Lab 0 1. Objectives Learn how to use AVR studio, an Integrated Development Environment (IDE) for developing AVR applications in Windows environments, to debug and run an AVR assembly program. Understand
More informationAVR Timers TIMER0. Based on:
AVR Timers TIMER0 Based on: http://maxembedded.wordpress.com/2011/06/24/avr-timers-timer0-2/ The basic concepts of AVR Timers. Let me summarize it: We have seen how timers are made up of registers, whose
More informationRegister-Level Programming
Introduction Register-Level Programming Programming can be considered a set a instructions that are executed in a precise order. A programming simulator can evaluate how instructions store, move and calculate
More information2 Basic operations with AT90S1200 and TINY12
2 Basic operations with AT90S1200 and TINY12 The best way to learn is through example and by doing things yourself. For the rest of the book we will cover example projects, many of which will be largely
More informationAssembly Programming in Atmel Studio 7 Step by Step Tutorial
Assembly Programming in Atmel Studio 7 Step by Step Tutorial Sepehr Naimi BIHE University 12/1/2017 Contents Introduction... 2 Downloading and Installing Atmel Studio... 3 Opening Atmel Studio... 3 Creating
More informationIAS0430 MICROPROCESSOR SYSTEMS
IAS0430 MICROPROCESSOR SYSTEMS Fall 2018 Arduino and assembly language Martin Jaanus U02-308 martin.jaanus@ttu.ee 620 2110, 56 91 31 93 Learning environment : http://isc.ttu.ee Materials : http://isc.ttu.ee/martin
More informationTopic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR
Topic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR Introduction Timer s objective Timer features Timer Registers - Understand function of each bit Initialization Introduction o In micro-p, we use counter
More informationModule 10: System Integration & Planning. Introduction to I/O Elementary I/O in AVR MSI devices
Module 10: System Integration & Planning Introduction to I/O Elementary I/O in AVR MSI devices Introduction Introduction o There are five types of project complexity possibilities: o Purely software o
More informationTIMSK=0b ; /* enables the T/C0 overflow interrupt in the T/C interrupt mask register for */
The codes below which help in better understanding of timers and counters. I have tested this code for atmega32. I have taken reference from www.avrfreaks.net. Hope you all will find this useful. Darsh
More informationEmbedded Systems and Software
Embedded Systems and Software Lab 4 Considerations Formatting for LCD Slide 1 Lab 4 Issues Displaying the Frequency and Duty Cycle on the LCD Formatting for LCD Slide 2 F = 2 5 H z D C = 7 5. 6 % Formatting
More informationMicroprocessors & Interfacing
Lecture Overview Microprocessors & Interfacing Interrupts (I) Lecturer : Dr. Annie Guo Introduction to Interrupts Interrupt system specifications Multiple sources of interrupts Interrupt priorities Interrupts
More informationEE 308: Microcontrollers
EE 308: Microcontrollers Assmbly Language Part I Aly El-Osery Electrical Engineering Department New Mexico Institute of Mining and Technology Socorro, New Mexico, USA January 30, 2018 Aly El-Osery (NMT)
More informationInterrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1
Interrupts (I) Lecturer: Sri Notes by Annie Guo Week8 1 Lecture overview Introduction to Interrupts Interrupt system specifications Multiple Sources of Interrupts Interrupt Priorities Interrupts in AVR
More informationAT90S Bit Microcontroller with 1K bytes Downloadable Flash AT90S1200. Features. Description. Pin Configuration
Features Utilizes the AVR Enhanced RISC Architecture 89 Powerful Instructions - Most Single Clock Cycle Execution 1K bytes of In-System Reprogrammable Downloadable Flash - SPI Serial Interface for Program
More informationET-BASE AVR ATmega64/128
ET-BASE AVR ATmega64/128 ET-BASE AVR ATmega64/128 which is a Board Microcontroller AVR family from ATMEL uses MCU No.ATmega64 and ATmega128 64PIN. Board ET-BASE AVR ATmega64/128 uses MCU s resources on
More informationAPPENDIX D FLOWCHARTS AND PSEUDOCODE OVERVIEW
APPENDIX D FLOWCHARTS AND PSEUDOCODE OVERVIEW This appendix provides an introduction to writing flowcharts and pseudocode. 689 Flowcharts If you have taken any previous programming courses, you are probably
More informationCOMP2121: Microprocessors and Interfacing. I/O Devices (II)
COMP2121: Microprocessors and Interfacing I/O Devices (II) http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 2, 2017 1 Overview Keyboard LCD (Liquid Crystal Display) 2 2 Input Switches (1/2)
More informationGetting Started with the HCS12 IDE
Getting Started with the HCS12 IDE B. Ackland June 2015 This document provides basic instructions for installing and using the MiniIDE Integrated Development Environment and the Java based HCS12 simulator.
More informationLab 9: On-Board Time Generation and Interrupts
Lab 9: On-Board Time Generation and Interrupts Summary: Develop a program and hardware interface that will utilize externally triggered interrupts and the onboard timer functions of the 68HC12. Learning
More information8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.
AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,
More informationLaboratory Exercise 4
Laboratory Exercise Input/Output in an Embedded System The purpose of this exercise is to investigate the use of devices that provide input and output capabilities for a processor. There are two basic
More informationAVR Simulation with the ATMEL AVR Studio 4 Updated: 8/3/2005
AVR Simulation with the ATMEL AVR Studio 4 Updated: 8/3/2005 Page 1 9/27/2005 Introduction The AVR Studio 4 is an Integrated Development Environment for debugging AVR software. The AVR Studio allows chip
More informationCOMP2121 Experiment 4
COMP2121 Experiment 4 1. Objectives In this lab, you will learn AVR programming on Parallel input/output; Some typical input/output devices; and Interrupts 2. Preparation Before coming to the laboratory,
More informationAVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo
AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo 1 Lecture Overview AVR ISA AVR Instructions & Programming (I) Basic construct implementation 2 Atmel AVR 8-bit RISC architecture
More information;Compiler Options.NOLIST.INCLUDE "C:\Program Files (x86)\atmel\avr Tools\AvrAssembler2\Appnotes\m8515def.inc"
;* CharTest.asm ;* ;* Created: 28/06/2017 9:37 p.m. ;* Author: ob1 ;ST7820 128 x 64 graphics mode character display 8 lines x 21 characters ;Modification and redistribution under provisions of GNU general
More informationAVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE
AVR 8-bit Microcontrollers AVR134: Real Time Clock (RTC) Using the Asynchronous Timer APPLICATION NOTE Features Real Time Clock with Very Low Power Consumption (10µA @ 3.3V) Very Low Cost Solution Adjustable
More informationAVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo
AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo 1 Lecture Overview AVR ISA AVR Instructions & Programming (I) Basic construct implementation 2 Atmel AVR 8-bit RISC architecture
More informationDevelopment Tools. 8-Bit Development Tools. Development Tools. AVR Development Tools
Development Tools AVR Development Tools This section describes some of the development tools that are available for the 8-bit AVR family. Atmel AVR Assembler Atmel AVR Simulator IAR ANSI C-Compiler, Assembler,
More informationUsing the KD30 Debugger
ELEC3730 Embedded Systems Tutorial 3 Using the KD30 Debugger 1 Introduction Overview The KD30 debugger is a powerful software tool that can greatly reduce the time it takes to develop complex programs
More informationFAKULTI KEJURUTERAAN ELEKTRIK FAKULTI KEJURUTERAAN ELEKTRIK UNIVERSITI TEKNOLOGI MALAYSIA KAMPUS SKUDAI JOHOR SKEE 3732 MICROPROCESSOR LABORATORY
Fakulti: Nama Matapelajaran: Kod Matapelajaran : SKEE 3732 FAKULTI KEJURUTERAAN ELEKTRIK Semakan Tarikh Keluaran Pindaan Terakhir No. Prosedur : 1 : September 2016 : September 2017 : PKUTMFKE(0)10 FAKULTI
More informationThe modules in this lab room are 4 line by 16 character display modules. The data sheet/users manual for the module is posted on My.Seneca.
LCD Modules A common output display device used with low cost embedded systems is a character LCD display. The displays are available as complete modules with a standard microprocessor parallel interface.
More informationMPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine
MPLAB SIM MPLAB IDE Software Simulation Engine 2004 Microchip Technology Incorporated MPLAB SIM Software Simulation Engine Slide 1 Welcome to this web seminar on MPLAB SIM, the software simulator that
More informationFIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)
(Revision-10) FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100) PART-A (Maximum marks : 10) I. Answer all
More informationAVR ISA & AVR Programming (I)
AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo Week 1 1 Lecture Overview AVR ISA AVR Instructions & Programming (I) Basic construct implementation Week 1 2 1 Atmel AVR 8-bit
More information8-bit Microcontroller with 8K Bytes Programmable Flash AT90C8534. Preliminary
Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 118 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General-purpose Working Registers Up
More informationModule 8: Atmega32 Stack & Subroutine. Stack Pointer Subroutine Call function
Module 8: Atmega32 Stack & Subroutine Stack Pointer Subroutine Call function Stack Stack o Stack is a section of RAM used by the CPU to store information temporarily (i.e. data or address). o The CPU needs
More information8-bit Microcontroller with 2K Bytes of Flash. ATtiny28L ATtiny28V
Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 90 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General-purpose Working Registers Up to
More informationshown in Figure 3. An example where the command 0x35 is sent to system 5 is shown in Figure 4. Figure 2. RC5 Frame Format Figure 3.
AVR410: RC5 IR Remote Control Receiver Features Low-cost Compact Design, Only One External Component Requires Only One Controller Pin, Any AVR device Can Be Used Size-efficient Code Figure 1. RC5 Receiver
More informationGUJARAT TECHNOLOGICAL UNIVERSITY
ELECTRONICS AND COMMUNICATION (11) MICROCONTROLLER AND INTERFACING (EC) SUBJECT CODE: 2151001 B.E. 5 th SEMESTER Type of course: Microcontroller Architecture and Programming Prerequisite: Students should
More information8-bit Microcontroller with 2K Bytes of In-System Programmable Flash AT90S2313
Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 118 Powerful Instructions Most Single Clock Cycle Execution 32x8GeneralPurposeWorkingRegisters Up to 10
More informationAGH University of Science and Technology Cracow Department of Electronics
AGH University of Science and Technology Cracow Department of Electronics Microprocessors laboratory Tutorial 7 Interrupts Author: Paweł Russek http://www.fpga.agh.edu.pl/upt ver. 25/05/16 1/11 1. Introduction
More information8-bit Microcontroller with 2K Bytes of In-System Programmable Flash AT90S2323 AT90LS2323 AT90S2343 AT90S/LS2323. Features.
Features Utilizes the AVR RISC Architecture AVR - High-performance and Low-power RISC Architecture 118 Powerful Instructions - Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers
More informationNEWBIE'S GUIDE TO AVR DEVELOPMENT A N IN TR O DU CT I O N I N TE N DE D FO R PEOPL E W I TH NO PRIOR AV R KNOWLE DG E AVRFREAKS.
NEWBIE'S GUIDE TO AVR DEVELOPMENT A N IN TR O DU CT I O N I N TE N DE D FO R PEOPL E W I TH NO PRIOR AV R KNOWLE DG E AVRFREAKS.NET JULY 2002 TABLE OF CONTENTS Newbie's Getting Started Guide...2 Preparing
More informationEmbedded Systems and Software
Embedded Systems and Software Lecture 11 Interrupts Interrupts Slide 1 Interrupts One way to think of interrupts is that they are hardwaregenerated functions calls Internal Hardware When timer rolls over,
More informationFundamental concept in computation Interrupt execution of a program to handle an event
Interrupts Fundamental concept in computation Interrupt execution of a program to handle an event Don t have to rely on program relinquishing control Can code program without worrying about others Issues
More information8-bit Microcontroller with 2K Bytes of In-System Programmable Flash. ATtiny22 ATtiny22L. Preliminary. Features. Description
Features Utilizes the AVR RISC Architecture AVR - High-performance and Low-power RISC Architecture 118 Powerful Instructions - Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers
More informationAGH University of Science and Technology Cracow Department of Electronics
AGH University of Science and Technology Cracow Department of Electronics Microprocessors laboratory Tutorial 7 Interrupts Author: Paweł Russek http://www.fpga.agh.edu.pl/upt ver. 01/07/14 1/12 1. Introduction
More informationChapter 4: Programming with MATLAB
Chapter 4: Programming with MATLAB Topics Covered: Programming Overview Relational Operators and Logical Variables Logical Operators and Functions Conditional Statements For Loops While Loops Debugging
More information8-bit Microcontroller with 1K Byte of In-System Programmable Flash AT90S1200
Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 89 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General-purpose Working Registers Up to
More informationMicrocontroller Overview
Microcontroller Overview Microprocessors/Microcontrollers/DSP Microcontroller components Bus Memory CPU Peripherals Programming Microcontrollers vs. µproc. and DSP Microprocessors High-speed information
More informationAN1745. Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas. Introduction
Order this document by /D Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas Introduction More and more applications are requiring liquid crystal displays
More informationProgramming Microcontroller Assembly and C
Programming Microcontroller Assembly and C Course Number CLO : 2 Week : 5-7 : TTH2D3 CLO#2 Student have the knowledge to create basic programming for microcontroller [C3] Understand how to program in Assembly
More informationW7100A / W7100. Version WIZnet Co., Inc. All Rights Reserved. For more information, visit our website at
W7100A / W7100 Debugger Guide Version 1.1 2012 WIZnet Co., Inc. All Rights Reserved. For more information, visit our website at http://www.wiznet.co.kr Copyright 2012 WIZnet Co., Inc. All rights reserved.
More informationGetting Started with STK200 Dragon
Getting Started with STK200 Dragon Introduction This guide is designed to get you up and running with main software and hardware. As you work through it, there could be lots of details you do not understand,
More informationMicrocontroller basics
FYS3240 PC-based instrumentation and microcontrollers Microcontroller basics Spring 2017 Lecture #4 Bekkeng, 30.01.2017 Lab: AVR Studio Microcontrollers can be programmed using Assembly or C language In
More informationEmbedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester
Embedded Systems PIC16F84A Internal Architecture Eng. Anis Nazer First Semester 2017-2018 Review Computer system basic components? CPU? Memory? I/O? buses? Instruction? Program? Instruction set? CISC,
More informationECED 3204 Microprocessor Midterm Reference Solution
ECED 3204 Microprocessor Midterm Reference Solution Date: October 26 2017 Time: 7:00pm-9:00pm Room: B225, B227, B229 Student name ID 1) Problem one has following two sub problems: a. Write an instruction
More informationExtending Encoder Button Functionality on your DDS Development Kit
Extending Encoder Button Functionality on your DDS Development Kit By Bruce Hall, W8BH The DDS kit by W8DIZ gives us a really useful input device: a rotary encoder with a pushbutton on its shaft. In my
More informationSection 1 AVR Studio User Guide
Section 1 AVR Studio User Guide 1.1 Introduction Welcome to AVR Studio from Atmel Corporation. AVR Studio is a Development Tool for the AVR family of microcontrollers. This manual describes the how to
More informationChapter 6 PROGRAMMING THE TIMERS
Chapter 6 PROGRAMMING THE TIMERS Reload Start Stop Programmabl e Prescaling Prescaling Loa d Timer-counter Device Reset Internal clock inputs External counting of inputs Free Running Lesson 1 Programmable
More informationLab Course Microcontroller Programming
Technische Universität München Fakultät für Informatik Forschungs- und Lehreinheit Informatik VI Robotics and Embedded Systems Lab Course Microcontroller Programming Michael Geisinger geisinge@in.tum.de
More informationIntroduction to Embedded Systems
Stefan Kowalewski, 4. November 25 Introduction to Embedded Systems Part 2: Microcontrollers. Basics 2. Structure/elements 3. Digital I/O 4. Interrupts 5. Timers/Counters Introduction to Embedded Systems
More informationAGH University of Science and Technology Cracow Department of Electronics
AGH University of Science and Technology Cracow Department of Electronics Microprocessors laboratory Tutorial A Using Arduino UNO for laboratory tutorials Author: Paweł Russek http://www.fpga.agh.edu.pl/upt
More informationLaboratory 10. Programming a PIC Microcontroller - Part II
Laboratory 10 Programming a PIC Microcontroller - Part II Required Components: 1 PIC16F88 18P-DIP microcontroller 1 0.1 F capacitor 3 SPST microswitches or NO buttons 4 1k resistors 1 MAN 6910 or LTD-482EC
More informationEmbedded Systems and Software. LCD Displays
Embedded Systems and Software LCD Displays Slide 1 Some Hardware Considerations Assume we want to drive an LED from a port. The AVRs can either source or sink current. Below is a configuration for sourcing.
More informationMicroprocessors & Interfacing
Lecture Overview Microprocessors & Interfacing Input/Output Devices Input devices Input switches Basics of switches Keypads Output devices LCD Lecturer : Dr. Annie Guo S2, 2008 COMP9032 Week8 1 S2, 2008
More informationELCT501 Digital System Design Winter Tutorial #11 FPGA Complete Design Flow with LCD Example
ELCT501 Digital System Design Winter 2014 Tutorial #11 FPGA Complete Design Flow with LCD Example Design a 4-bit Up-Counter with Enable Design Flow Steps: 1. Write VHDL code for the counter. 2. Test the
More informationAPPLICATION NOTE. Atmel AVR057: Internal RC Oscillator Calibration for ATtiny4/5/9/10/20/40. 8-bit Atmel Microcontrollers. Features.
APPLICATION NOTE Features Atmel AVR057: Internal RC Oscillator Calibration for ATtiny4/5/9/10/20/40 8-bit Atmel Microcontrollers Calibration of the internal 8MHz RC Oscillator for Atmel ATtiny4/5/9/10/20/40
More informationCMPE C Programming & Embedded Systems. Discussion I (Version 2.0) August 31, 2014
CMPE 311 - C Programming & Embedded Systems Discussion I (Version 2.0) August 31, 2014 Version History Version 2.1 - (August 31, 2015) - Addition Pin Connections Section and Document Verification. Version
More informationInterrupt and Timer ISRs. Student's name & ID: Partner's name(s) & ID(s): Your Section number & TA's name
MPS Interrupt Lab Exercise Interrupt and Timer ISRs Student's name & ID: Partner's name(s) & ID(s): Your Section number & TA's name Notes: You must work on this assignment with your partner. Hand in a
More informationWatchdog Timer. The Basics. The watchdog timer operates independent of the CPU, peripheral subsystems, and even the clock of the MCU.
Watchdog Timer The Basics The watchdog timer watches over the operation of the system. This may include preventing runaway code or in our C example, a lost communications link. The watchdog timer operates
More informationPhysics 120B: Lecture 11. Timers and Scheduled Interrupts
Physics 120B: Lecture 11 Timers and Scheduled Interrupts Timer Basics The ATMega 328 has three @mers available to it (Arduino Mega has 6) max frequency of each is 16 MHz, on Arduino TIMER0 is an 8- bit
More informationThe HC11. Alexandra Carey & Richard Hughey. University of California, School of Engineering Santa Cruz, CA 95064
Abstract A microcontroller is a microprocessor that controls everyday appliances such as microwaves and wristwatches. The microkits used by computer engineering classes use a Motorola HC11 microcontroller
More informationLecture 7 Tao Wang 1
Lecture 7 Tao Wang 1 Objectives In this chapter, you will learn about: Interactive loop break and continue do-while for loop Common programming errors Scientists, Third Edition 2 while Loops while statement
More informationWhat is Pipelining. work is done at each stage. The work is not finished until it has passed through all stages.
PIPELINING What is Pipelining A technique used in advanced microprocessors where the microprocessor begins executing a second instruction before the first has been completed. - A Pipeline is a series of
More informationIntroduction to AVR-STUDIO
DEPARTAMENTO DE TECNOLOGÍA ELECTRÓNICA ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA INFORMÁTICA Introduction to AVR-STUDIO Computer Structure 1.Introduction and goals The goals of this session are the following:
More informationECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015
ECE 353 Lab 4 General MIDI Explorer Professor Daniel Holcomb Fall 2015 Where are we in Course Lab 0 Cache Simulator in C C programming, data structures Cache architecture and analysis Lab 1 Heat Flow Modeling
More informationATmega Interrupts. Reading. The AVR Microcontroller and Embedded Systems using Assembly and C) by Muhammad Ali Mazidi, Sarmad Naimi, and Sepehr Naimi
1 P a g e ATmega Interrupts Reading The AVR Microcontroller and Embedded Systems using Assembly and C) by Muhammad Ali Mazidi, Sarmad Naimi, and Sepehr Naimi Chapter 10: AVR Interrupt Programming in Assembly
More informationSKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.
SKP16C26 Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance
More informationSpeed and Size-Optimized Implementations of the PRESENT Cipher for Tiny AVR Devices
Speed and Size-Optimized Implementations of the PRESENT Cipher for Tiny AVR Devices Kostas Papagiannopoulos Aram Verstegen July 11, 2013 Papagiannopoulos and Verstegen July 11, 2013 Speed and Size-Optimized
More information[TUT] Newbie's Guide to AVR Interrupts
This tutorial is about interrupt driven USART receive and transmit routines written in AVR assembly. The hardware is: Arduino Mega2560 Adafruit Ultimate GPS IBM PC Atmel JTAGICE3 Software: Atmel AS6.1
More informationDepartment of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1
Timer/Counters Department of EIE / Pondicherry Engineering College 1 The 8051 has two internal sixteen bit hardware Timer/Counters. Each Timer/Counter can be configured in various modes, typically based
More informationSection 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:
M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using
More informationLecture 20: AVR Programming, Continued. AVR Program Visible State (ones we care about for now)
18 100 Lecture 20: AVR Programming, Continued S 15 L20 1 James C. Hoe Dept of ECE, CMU April 2, 2015 Today s Goal: You will all be ace AVR hackers! Announcements: Midterm 2 can be picked up in lab and
More information8-bit Microcontroller with 1K Bytes Flash. ATtiny10 ATtiny11 ATtiny12. Preliminary. Features. Pin Configuration
Features Utilizes the AVR RISC Architecture High-performance and Low-power 8-bit RISC Architecture 90 Powerful Instructions - Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers
More informationAVR MICROCONTROLLER ARCHITECTURTE
AVR MICROCONTROLLER ARCHITECTURTE AVR MICROCONTROLLER AVR- Advanced Virtual RISC. The founders are Alf Egil Bogen Vegard Wollan RISC AVR architecture was conceived by two students at Norwegian Institute
More informationLogic Instructions and Programs READING
1 P a g e Logic Instructions and Programs READING The AVR Microcontroller and Embedded Systems using Assembly and C) by Muhammad Ali Mazidi, Sarmad Naimi, and Sepehr Naimi Chapter 5: Arithmetic, Logic
More informationEMCH 367 Fundamentals of Microcontrollers Example_RPM_2 EXAMPLE RPM_2
OBJECTIVE This example has the following objectives: EXAMPLE RPM_2 Review the used of two time captures to calculate the time duration of an event Illustrate the use of scaling factors (100s) to deal with
More informationDESIGN NOTE #032. AVR Boot Loader. Introduction. Overview AUTHOR: MARIANO BARRÓN RUIZ KEYWORDS: BOOT LOADER, SPM, SELF-PROGRAMMING
DESIGN NOTE AUTHOR: #032 MARIANO BARRÓN RUIZ ISPBARUM@SB.EHU.ES KEYWORDS: BOOT LOADER, SPM, SELF-PROGRAMMING This document is originally distributed by AVRfreaks.net, and may be distributed, reproduced,
More information