Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  pak het project tint.zip.

Slides:



Advertisements
Similar presentations
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  LCD aansturen  een scrollende text laten zien.
Advertisements

Vervolg C Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1 Onderwerpen voor vandaag Dallas one-wire interface Opgave:
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Vervolg C Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1 Onderwerpen voor vandaag functie definitions;.h files;
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
Scientific Programming for(i=0; i b) { a = func1(c,d,i*10); } else if(a < b) { a = func2(e,f,i*10); } else { a = func3(g,h,i*10);
C Examples 1.
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1.
8051 Interrupts.  Contrast edge-triggered with level-triggered interrupts  Program the 8051 for interrupt-based serial communication  Define the interrupt.
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
INTERRUPTS PROGRAMMING
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
ECE 425 Timer 1 Timer Functions Two main modes: – Input capture Used for timing external events – Match (Output compare) Allows use as a simple function.
ARM Timers.
System Clocks.
M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.
Revised: Aug 1, ECE 263 Embedded System Design Lessons 23, 24 - Exceptions - Resets and Interrupts.
Computertechniek 2 – ARM assembler Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  Herhaling ARM assembler instructies.
Robotraffic software and programming aids Robotics Laboratory Faculty of Mechanical Engineering Technion Israel Institute of Technology.
Lecture 11: TI MSP430 Timers Compare Modes
LAB 8: Program Design Pattern and Software Architecture
EZ-Additive Synthesizer By Max Bastien 12/14/07. Problem Statement Mystery of keyboards reproducing a wide range of sounds from any particular instrument.
1 Run-Time Methods for Making Embedded Systems Robust.
8086 has 2 interrupt inputs 1. NMI 2. INTR For application where we have interrupts from multiple sources, use an external device called a Priority Interrupt.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
C Examples 5. Download Links MPLAB IDE dsPIC30F4011/4012 Data Sheet dsPIC30F Family Reference Manual MikroC MikroC Manual MikroC Quick Reference.
Timer Timer is a device, which counts the input at regular interval (δT) using clock pulses at its input. The counts increment on each pulse and store.
INT- interrupt program execution 1. It decrements the sp by 2 and pushes the flag registers on the stack. 2. Decrement the sp by 2 and push the content.
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 4 Standard Single Purpose Processors: Peripherals.
CS-280 Dr. Mark L. Hornick 1 Atmel Timer/Counter System Most microcontrollers include some type of timer system Facilitates real-time monitoring and control.
Saxion University of Applied Sciences Advanced Microcontrollers A practical approach.
4 - 1 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH) Module 4 : Interrupt System C28x 32-Bit-Digital.
1 68HC11 Timer HC11 or HC12: Chapter HC11 Timer Subsystem  Several timing functions: Basic timing Basic timing Real time interrupts Real time.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
Real Time Interrupts Section Real-Time Interrupt (RTI) Most operating systems (OS) require an interrupt every T seconds by the RTI RTI interrupts.
C Examples 1. Download Links dsPIC30F4011/4012 Data Sheet dsPIC30F4013/3014 dsPIC30F Family Reference Manual MikroC MikroC Manual MikroC Quick Reference.
MICRO-CONTROLLER MOTOROLA HCS12 Interrupts Mechatronics Department Faculty of Engineering Ain Shams University.
8051 Aula 02 Prof Afonso Ferreira Miguel. Microcontrolador 8051 (MCS-51)  Timers do MCS51 Two 16-bit Counter/Timers: Two 16-bit Counter/Timers: Up counters,
Arduino Mega Arduino Mega 2560 Arduino Mega 2560.
Lecture 3 CSE 341 – Microprocessors Lecture 3 Md. Omar Faruqe UB 1228
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
1 68HC11 Timer. 2 68HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output compare.
Timer & Watch Dog Test UNIT 16 로봇 SW 교육원 조용수. 학습 목표 Timer Init Timer Delay Test Timer Interrupt Test –One Shot Mode –Periodic Mode Watch Dog Test 시계 만들어.
Computer Operating Properly Module MTT COMPUTER OPERATING PROPERLY MODULE (COP)
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
1 Round Robin Non-Preemptive Scheduler Lecture 12.
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
1 Lab3 – Optical Sensor. 2 When a light path is interrupted and when it is completed, the AVR records both events. Uses typically include counting objects.
Sensing Algorithm using IR Sensor and ADC Soong-sil University. Robotics 기 정 두 원.
One more PIC18F252 example and revision for exam B222L Branislav Vuksanovic, UoP, ECE.
TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names.
80C51 Block Diagram ECE Overview.
Interrupts and interrupt responses
68HC11 Interrupts & Resets.
Timer and Interrupts.
4-Integrating Peripherals in Embedded Systems
Timer Source: under
Round Robin Non-Preemptive Scheduler
4-Integrating Peripherals in Embedded Systems
UNIT 5 TIMRERS/COUNTERS
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
Chapter 11 Multiple interrupts
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
class PrintOnetoTen { public static void main(String args[]) {
8051 Micro Controller.
Wave Generation and Input Capturing
Timer Source: under
Presentation transcript:

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  pak het project tint.zip

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 2 int Timeout = 0; extern void MyTimerInterrupt( void ){ // signal the timeout to the main Timeout = 1; // clear interrupt flags: prepare for next interrupt T1IR = 0xFF; }

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 3 extern int main(){ static int led = 1; InitTimer( MyTimerInterrupt ); while (1){ if( Timeout ){ Timeout = 0; // toggle LED led = !led; if (led) hc595(1); else hc595(0); } return 0; }

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 4 void InitTimer( void (*func)(void) ) { __disable_interrupts(); // Initialise timer1 T1TCR = 0;// stop and reset counter and prescaler T1PC = 2/*div by 2*/ - 1;// prescale counter T1MR0 = / 4/*VPBDIV*/;// max counter value T1MCR = 1<<1 | 1<<0;// reset and interrupt on match T1IR = 0xFF; // clear interrupt flags // Initialise VIC VICIntSelect &=~ (1<<5);// select IRQ mode instead of FIQ VICVectCntl[0] = 0x20/*enable*/ | 5/*timer 1*/; *irqVector0 = func;// wrapped interrupt vector VICIntEnable = 1<<5;// enable interrupt source T1TCR = 1;// start VICVectAddr = 0xFF;// update priority hardware __enable_interrupts(); }

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 5 Datasheet P.137 T1TCR = 0;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 6 Datasheet P.136 T1PC = 2/*div by 2*/ - 1;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 7 Datasheet P.137 T1MR0 = / 4/*VPBDIV*/;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 8 Datasheet P.137 T1MCR = 1<<1 | 1<<0;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 9 Datasheet P.136 T1IR = 0xFF;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 10 Datasheet P.68

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 11 Datasheet P.136 VICIntSelect &=~ (1<<5);

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 12 Datasheet P.66 VICVectCntl[0] = 0x20/*enable*/ | 5/*timer 1*/;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 13 Datasheet P.66 *irqVector0 = func;

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 14 Datasheet P.137 T1TCR = 1;