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

Info icon This 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
Image of page 1

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

View Full Document Right 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
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
Image of page 3

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

View Full Document Right 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
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
Image of page 5

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

View Full Document Right 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); }
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern