ECT sinusoid by nikeborome

VIEWS: 4 PAGES: 13

									      ECT 358
       Lecture 23
Introduction to Embedded
         Systems
If a task is once begun, never
leave it ‗till it‘s done‘. Be the
labor great or small, Do it well
or not at all.

I have glorified thee on the earth: I have
  finsihed the work which thou gavest me to
  do. John 17:4
    Real-Time Embedded Systems
            Introduction
• What is an Embedded System?
     – Computer is built in
     – Not obvious to the user
     – Applications determined by designer, not user
     – Applications may be scheduled or event driven
•   Four Types of systems
     – Purely Cyclic
     – Mostly Cyclic
     – Asynchronous and somewhat predictable
     – Asynchronous and unpredictable
Purely Cyclic

• Every task executes periodically
  – Tasks may have different periods
• I/O operations are managed
  – May be polled or sampled
• Resource demands relatively constant
  from period to period
• Typical example
  – Flight Control System
Mostly Cyclic

• Most tasks execute periodically
  – Tasks may have different periods
• System must handle aperiodic tasks
  – Error conditions, operator intervention, etc.
• Examples
  – Digital Avionics System
  – Industrial Plant Control System
Asynchronous and Somewhat
Predictable
• Tasks not periodic
• Demands on the system a function of the
  tasks required
• Demands and period ranges are bounded
  or statistically predictable
• Examples
  – Multimedia communication
  – Radar signal processing
  – Tracking systems
Asynchronous and
Unpredictable
• Event driven applications
• Example
  – User interface
Purely Cyclic System – A
sampled data system example                      S1




                                                 S2




Data Acquistion                         Analog
                        A/D Converter            S3
  Computer                              Switch



                  Control


                            Control
                                                 S4




                                                 S5
       Purely Cyclic System – A
       sampled data system example
       (Cont)
       • Let S1 be a sinusoid with frequency of 100 Hz. How
           often should we sample it?
            – Nyquist says at least twice the highest frequency
              (e.g. 200 Hz)
            – Better rule for practice is 10 times the highest
              frequency (see example for 100 Hz Sine Wave below)
                                  sin(628t)                                                       sin(628t) Sampled at 1 KHz

1.5                                                                         1.5

  1                                                                           1

0.5                                                                         0.5


  0                                                                           0
       0   0.005   0.01   0.015      0.02     0.025   0.03   0.035   0.04          0   0.005   0.01     0.015      0.02        0.025   0.03   0.035
-0.5                                                                        -0.5

 -1                                                                          -1

-1.5                                                                        -1.5
           Purely Cyclic System – A
           sampled data system example
1.5
           (Cont)                    sin(628t)


                                                                                        1.5
                                                                                                                 sin(628t) Sampled at 500 Hz




  1                                                                                      1


0.5                                                                                     0.5


  0                                                                                      0
       0   0.005    0.01     0.015       0.02       0.025      0.03   0.035   0.04            0       0.005   0.01     0.015       0.02        0.025   0.03   0.035
-0.5                                                                                   -0.5


 -1                                                                                      -1


-1.5                                                                                   -1.5




                           sin(628t) Sampled at 250 Hz                                                          sin(628t) Sampled at 200 Hz


1.5                                                                                   8E-14

                                                                                      6E-14
  1
                                                                                      4E-14
0.5
                                                                                      2E-14

  0                                                                                           0
       0    0.005     0.01       0.015           0.02       0.025     0.03    0.035               0   0.005   0.01      0.015      0.02        0.025   0.03   0.035
                                                                                      -2E-14
-0.5
                                                                                      -4E-14
 -1
                                                                                      -6E-14

-1.5                                                                                  -8E-14
       Sampling a Square Wave (100
       Hz)                 f(t)                                                   f500(t)


1.5                                                      1.5


  1                                                        1


0.5                                                      0.5


  0                                                        0
       0   0.01   0.02              0.03   0.04   0.05          0   0.01   0.02             0.03   0.04   0.05
-0.5                                                     -0.5


 -1                                                        -1


-1.5                                                     -1.5




                         f1000(t)                                                 f200(t)


1.5                                                      1.5


  1                                                        1


0.5                                                      0.5


  0                                                        0
       0   0.01   0.02              0.03   0.04   0.05          0   0.01   0.02             0.03   0.04   0.05
-0.5                                                     -0.5

 -1                                                       -1

-1.5                                                     -1.5
Purely Cyclic System – A
sampled data system example
(Cont)
• Problem is to design software which will control the
    sampling
•   Example 1—all signals are 100 Hz.
•   Pseudo Code for data acquisition
    While run is true
         Begin
              I = 1;
              While I is < 5
                  Begin
                    Select signal[I];
                    Convert to Digital;
                    Store in A[I];
                    I = I + 1;
                  End;
         End;
         Purely Cyclic System – A
         sampled data system example
         •        This works if processor is ―fast enough‖
         •        Example concerned with sampling only
         •        If samples of each signal are taken at 1 ms intervals, it works fine.
         •        For a 5 signal system, this implies we have 200 microseconds to
                  acquire each sample (including overhead).


    S1                                   S1                              S1                              S1


             S2                               S2                              S2                              S2


                    S3                             S3                              S3                              S3


                         S4                             S4                              S4                              S4


                              S5                             S5                              S5                              S5




0                                  1ms                            2 ms                            3 ms                            4 ms

								
To top