ch4 - Embedded Systems Design: A Unified Hardware/Software...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Embedded Systems Design: A Unified Hardware/Software Introduction Chapter 4 Standard Single Purpose Processors: Peripherals
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis Introduction Single-purpose processors Performs specific computation task Custom single-purpose processors Designed by us for a unique task Standard single-purpose processors “Off-the-shelf” -- pre-designed for a common task a.k.a., peripherals serial transmission analog/digital conversions
Background image of page 2
3 Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis Timers, counters, watchdog timers Timer: measures time intervals To generate timed output events e.g., hold traffic light green for 10 s To measure input events e.g., measure a car’s speed Based on counting clock pulses E.g., let Clk period be 10 ns And we count 20,000 Clk pulses Then 200 microseconds have passed 16-bit counter would count up to 65,535*10 ns = 655.35 microsec., resolution = 10 ns Top: indicates top count reached, wrap-around 16-bit up counter Clk Cnt Basic timer Top Reset 16
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis Counters Counter: like a timer, but counts pulses on a general input signal rather than clock e.g., count cars passing over a sensor Can often configure device as either a timer or counter 16-bit up counter Clk 16 Cnt_in 2x1 mux Mode Timer/counter Top Reset Cnt
Background image of page 4
5 Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis Other timer structures Top2 Time with prescaler 16-bit up counter Clk Prescaler Mode Interval timer Indicates when desired time interval has passed We set terminal count to desired interval Number of clock cycles = Desired time interval / Clock period Cascaded counters Prescaler Divides clock Increases range, decreases resolution 16-bit up counter Clk 16 Terminal count = Top Reset Timer with a terminal count Cnt 16-bit up counter Clk 16-bit up counter 16 Cnt2 Top1 16/32-bit timer Cnt1 16
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis Example: Reaction Timer indicator light reaction button time: 100 ms LCD /* main.c */ #define MS_INIT 63535 void main(void){ int count_milliseconds = 0; configure timer mode set Cnt to MS_INIT wait a random amount of time turn on indicator light start timer while (user has not pushed reaction button){ if(Top) { stop timer set Cnt to MS_INIT start timer reset Top count_milliseconds++; } } turn light off printf(“time: %i ms“, count_milliseconds); } Measure time between turning light on and user pushing button 16-bit timer, clk period is 83.33 ns, counter
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/02/2011 for the course CS 550 taught by Professor Young during the Spring '11 term at New York Institute of Technology-Westbury.

Page1 / 17

ch4 - Embedded Systems Design: A Unified Hardware/Software...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online