Advanced Embedded Systems Design - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Advanced Embedded Systems Design

Description:

Advanced Embedded Systems Design. Lecture 3 Time triggered tasking and controlling ... Recode the time tasking example to: 1) Print 'Hello World' as the task ... – PowerPoint PPT presentation

Number of Views:130
Avg rating:3.0/5.0
Slides: 9
Provided by: MSt51
Category:

less

Transcript and Presenter's Notes

Title: Advanced Embedded Systems Design


1
Advanced Embedded Systems Design
  • Lecture 3 Time triggered tasking and controlling
    timing and
  • BAE 5030 - 003
  • Fall 2004
  • Instructor Marvin Stone
  • Biosystems and Agricultural Engineering
  • Oklahoma State University

2
Goals for Class Today
  • Questions over reading
  • Priority inversion (Carol Jones)
  • Time triggered tasking and use of hardware delay
  • Keil Compiler
  • ISRs
  • Profiling
  • Set assignment

3
Delay Hardware Timer/Counter peripherals
  • Typically provide
  • Counter that can be read from the microcontroller
  • 8 to 32 bits wide
  • Pre-loaded from microcontroller or auto-reload
  • Driven by
  • Microcontroller clock (Timer)
  • External source (Counter)
  • Interrupts on
  • Overflow
  • Input transition (Pulse width measurement)
  • Edge and level
  • Enable
  • Timer run
  • Interrupt

4
Additional Timer/Counter peripheral features
  • Functional tasks addressed by counter / timer
    devices
  • Time triggering interrupt or polled timing
  • Pulse counting External input, read at period
    of interest, may provide gated counting
  • Duty cycle measurement pulse count high and low
  • Pulse width measurement
  • PWM generation
  • Advanced features
  • PWM facilities duty cycle / period control,
    write on the fly
  • Auto-reload after timeout
  • Match and latch - accumulate time or count then
    latch another timer
  • Stepper motor control

5
Example 8051 Timer Mode 0,1
  • 8051 timer 0,1 in Mode 0
  • 8051 timer 0,1 in Mode 1

6
Example 8051 Timer Mode 0,1
  • 8051 timer 0,1 in Mode 2
  • Mode 3 TL0 is an 8-bit Timer/Counter. TH0 is an
    8-bit Timer using Timer 1s TR0 and TF0 bits.
    Mode 3 for Timer 1 halts timer 1
  • Timer 2 (3) Generally has a 16 bit auto-reload
    mode

7
Use of hardware to control timing
  • General structure of a hardware timed loop
  • For a manually read timer, provision should be
    made to detect timer overflow
  • If task is too long, a timer cycle may be missed
  • Review code for hardware delay (Chapter 11 code)
  • Review code for ISR on web
  • Coding rules
  • Timer setup
  • ISR
  • Multi-Tasking

8
Assignment
  • Recode the time tasking example to
  • 1) Print Hello World as the task
  • 2) Lengthen the task period to 10 ms.
  • Read Pont, Chapters 13,14
  • Tutorial 30 min
  • Explain a pre-emptive two three task scheduler
Write a Comment
User Comments (0)
About PowerShow.com