SlideShare a Scribd company logo
1 of 50
Download to read offline
Maths is not everything

Embedded Systems
5 - Development of microprocessor-based systems

Architectures and components
Debugging
Manufacturing Testing
RMR©2012

Example
Maths is not everything

Development of Microprocessor-based Systems
Architectures and Components

RMR©2012
Software architecture

Functional description must be broken into
pieces:
division among people;
conceptual organization;

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

performance;
testability;
maintenance.
Hardware and software architectures

Hardware and software are intimately
related:
software doesn’t run without hardware;

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

how much hardware you need is
determined by the software
requirements:
speed;
memory.
Software components

Need to break the design up into pieces
to be able to write the code.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Some component designs come up often.
A design pattern is a generic description
of a component that can be customized
and used in different circumstances.
Software state machine

State machine keeps internal state as a
variable, changes state based on inputs.
Uses:
control-dominated code;

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

reactive systems.
State machine specification

A

in1=1/x=a

B

r=0/out2=1

r=1/out1=0
in1=0/x=b

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

s=0/out1=0

C

D
s=1/out1=1
C code structure

Current state is kept in a variable.
State table is implemented as a switch.
Cases define states.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

States can test inputs.

Switch is repeatedly evaluated in a while
loop.
Software design techniques

Want to develop as much code as possible
on a standard platform:
friendlier programming environment;

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

easier debugging.

May need to devise software stubs to
allow testing of software elements
without the full hardware/software
platform.
Host/target design

Use a host system to prepare software
for target system:

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

target
system

host system

serial line
Host-based tools

Cross compiler:
compiles code on host for target system.

Cross debugger:

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

displays target state, allows target system to
be controlled.
Evaluation boards

Designed by CPU manufacturer or others.
Includes CPU, memory, some I/O devices.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

May include prototyping section.
CPU manufacturer often gives out
evaluation board netlist---can be used as
starting point for your custom board
design.
Adding logic to a board

Programmable logic devices (PLDs) provide
low/medium density logic.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Field-programmable gate arrays (FPGAs)
provide more logic and multi-level logic.
Application-specific integrated circuits
(ASICs) are manufactured for a single
purpose.
The PC as a platform

Advantages:
cheap and easy to get;
rich and familiar software environment.

Disadvantages:

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

requires a lot of hardware resources;
not well-adapted to real-time.
Maths is not everything

Development of Microprocessor-based Systems
Debugging Embedded Systems

RMR©2012
Debugging embedded systems

Challenges:
target system may be hard to observe;
target may be hard to control;
may be hard to generate realistic inputs;

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

setup sequence may be complex.
Software debuggers

A monitor program residing on the target
provides basic debugger functions.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Debugger should have a minimal footprint
in memory.
User program must be careful not to
destroy debugger program, but , should
be able to recover from some damage
caused by user code.
Breakpoints

A breakpoint allows the user to stop
execution, examine system state, and
change state.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Replace the breakpointed instruction with
a subroutine call to the monitor program.
ARM breakpoints

0x400 MUL r4,r6,r6

0x400
0x404 ADD r2,r2,r4 0x404
0x408 ADD r0,r0,#1 0x408
0x40c
0x40c B loop

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

uninstrumented code

MUL r4,r6,r6
ADD r2,r2,r4
ADD r0,r0,#1
BL bkpoint

code with breakpoint
Breakpoint handler actions

Save registers.
Allow user to examine machine.
Before returning, restore system state.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Safest way to execute the instruction is to
replace it and execute in place.
Put another breakpoint after the replaced
breakpoint to allow restoring the original
breakpoint.
In-circuit emulators

A microprocessor in-circuit emulator is a
specially-instrumented microprocessor.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Allows you to stop execution, examine
CPU state, modify registers.
Logic analyzers

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

A logic analyzer is an array of low-grade
oscilloscopes:
Logic analyzer architecture

sample
memory

UUT
system clock

microprocessor

vector
address
controller

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

clock
gen

state or
timing mode
keypad

- Checking memory (e.g. cache misses) or I/O access
- Checking execution time (marks needed)

display
How to exercise code

Run on host system.
Run on target system.
Hardware/Software verification
Run in instruction-level simulator.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Run on cycle-accurate simulator (e.g. SoC).
Run in hardware/software co-simulation
environment.
Maths is not everything

Development of Microprocessor-based Systems
Manufacturing

RMR©2012
Manufacturing testing

Goal: ensure that manufacturing produces
defect-free copies of the design.
Can test by comparing unit being tested
to the expected behavior.
But running tests is expensive.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Maximize confidence while minimizing
testing cost.
Design for testability
take manufacturing test into account during design
Testing concepts

Yield: proportion of manufactured
systems that work.
Proper manufacturing maximizes yield.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Proper testing accurately estimates yield.

Field return: defective unit that leaves
the factory.
Faults

Manufacturing problems can be caused by
many things.
Fault model: model that predicts effects
of a particular type of fault.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Fault coverage: proportion of possible
faults found by a set of test.
Having a fault model allows us to determine fault
coverage.
Software vs. hardware testing

When testing code, we have no fault
model.
We verify the implementation, not the manufacturing.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Simple tests (e.g., Error Correcting Codes) work well
to verify software manufacturing.

Hardware requires manufacturing tests in
addition to implementation verification.
Hardware fault models

Stuck-at 0/1 fault model:
output of gate is always 0/1.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

01

0
Combinational testing

Every gate can be stuck-at-0, stuck-at-1.
Usually test for single stuck-at-x faults
One fault at a time.
Multiple faults can mask each other.

We can generate a test for a gate by:
controlling the gate’s input;
Maths is not everything

RMR©2012

© 2008 Wayne Wolf

observing the gate’s output through other gates.
Sequential testing

A state machine is combinational logic +
registers.
Sequential testing is considerably harder.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

A single stuck-at fault affects the machine on every
cycle.
Fault behavior on one cycle can be masked by same
fault on other cycles.
Scan chains

A scannable register operates in two
modes:
normal;
scan---forms an element in a shift register.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Using scan chains reduces sequential
testing to combinational testing.
Unloading/unloading scan chain is slow.
May use partial scan.
Test generation

Automatic test pattern generation
(ATPG) programs: produce a set of tests
given the logic structure.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Some faults may not be testable--redundant.
redundancy may have been added for avoiding glitches
Timeout on a fault may mean hard-to-test or
untestable.
Boundary scan

Simplifies testing of multiple chips on a
board.
Registers on pins can be configured as a scan
chain (JTAG standard interface)

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Test Access Port
JTAG

Also used as an OCDM interface
e.g. MSP430 responds to various commands sent over
JTAG:
Set watchpoint and breakpoint triggers
Poll CPU status (e.g., if halted at a breakpoint)
Maths is not everything

RMR©2012

Poll the state-storage buffer (for information
stored at watchpoint trigger)
Poll the program counter (PC)
Maths is not everything

Development of Microprocessor-based Systems
Example
Designing an Alarm Clock

RMR©2012
Alarm clock interface

Alarm on

Alarm off
buzzer

PM

Alarm
ready

light

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

set
time

set
alarm

hour minute

button
Operations

Set time: hold set time, depress hour,
minute.
Set alarm time: hold set alarm, depress
hour, minute.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Turn alarm on/off: depress alarm on/off.
Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Alarm clock requirements
Alarm clock class diagram

1

Lights*

1

Display

1

1
1

1

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Buttons*

Speaker*

1

Mechanism
1
Alarm clock physical classes

RMR©2012

Speaker*

digit-val()
digit-scan()
alarm-on-light()
PM-light()

Maths is not everything

Buttons*

set-time(): boolean
set-alarm(): boolean
alarm-on(): boolean
alarm-off(): boolean
minute(): boolean
hour(): boolean

buzz()

© 2008 Wayne Wolf

Lights*
Display class

Display

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

time[4]: integer
alarm-indicator: boolean
PM-indicator: boolean
set-time()
alarm-light-on()
alarm-light-off()
PM-light-on()
PM-light-off()
Mechanism class

Mechanism

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Seconds: integer
PM: boolean
tens-hours, ones-hours: integer
tens-minutes, ones-minutes: integer
alarm-ready: boolean
alarm-tens-hours, alarm-ones-hours:
integer
alarm-tens-minutes, alarm-ones-minutes:
integer
scan-keyboard()
update-time()
Update-time behavior

update seconds
with rollover
Rollover?

display.set-time(current time)

F
Time >= alarm and alarm-on?

T

T

update hh:mm
with rollover

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

alarm.buzzer(true)
AM->PM
PM=true

PM->AM
PM=false

F
Scan-keyboard behavior

compute button activations
alarm-ready=
true

Set-time and not
set-alarm and hours

Alarm-on

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Alarm-off

alarm-ready=
false
alarm.buzzer(false)

Set-time and not setalarm and minutes

save button
states

only one
activation

Increment time
tens w. rollover
and AM/PM

Increment time
ones w. rollover
and AM/PM
System architecture

Includes:
periodic behavior (clock);
aperiodic behavior (buttons, buzzer activation).

Two major software components:

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

interrupt-driven routine updates time;
foreground program deals with buttons, commands.
Interrupt-driven routine

Timer probably can’t handle one-minute
interrupt interval.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Use software variable to convert
interrupt frequency to seconds.
Foreground program

Operates as while loop:
while (TRUE) {
read_buttons(button_values);

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

process_command(button_values);
check_alarm();
}
Testing

Component testing:
test interrupt code on the platform;
can test foreground program using a mock-up.

System testing:

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

relatively few components to integrate;
check clock accuracy;
check recognition of buttons, buzzer, etc.

More Related Content

What's hot

One integrated platform for all activities,from engineering to production
One integrated platform for all activities,from engineering to productionOne integrated platform for all activities,from engineering to production
One integrated platform for all activities,from engineering to productionS Jebaraj
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 sessionSameh El-Ashry
 
UVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONUVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONIAEME Publication
 
How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?Sameh El-Ashry
 
UVM Methodology Tutorial
UVM Methodology TutorialUVM Methodology Tutorial
UVM Methodology TutorialArrow Devices
 
Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...
Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...
Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...DVClub
 
Microcontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-CoreMicrocontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-CoreVLSICS Design
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic SequencesArrow Devices
 
"Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S...
"Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S..."Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S...
"Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S...Marina Krotofil
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog Ramdas Mozhikunnath
 
Agilent flash programming agilent utility card versus deep serial memory-ca...
Agilent flash programming   agilent utility card versus deep serial memory-ca...Agilent flash programming   agilent utility card versus deep serial memory-ca...
Agilent flash programming agilent utility card versus deep serial memory-ca...AgilentT&M EMEA
 
Understanding and Improving Device Access Complexity
Understanding and Improving Device Access ComplexityUnderstanding and Improving Device Access Complexity
Understanding and Improving Device Access Complexityasimkadav
 
Uvm presentation dac2011_final
Uvm presentation dac2011_finalUvm presentation dac2011_final
Uvm presentation dac2011_finalsean chen
 
2008 Asts Technical Paper Protocol Aware Ate Submitted
2008 Asts Technical Paper Protocol Aware Ate Submitted2008 Asts Technical Paper Protocol Aware Ate Submitted
2008 Asts Technical Paper Protocol Aware Ate SubmittedEric Larson
 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesRamdas Mozhikunnath
 

What's hot (20)

CPU Verification
CPU VerificationCPU Verification
CPU Verification
 
One integrated platform for all activities,from engineering to production
One integrated platform for all activities,from engineering to productionOne integrated platform for all activities,from engineering to production
One integrated platform for all activities,from engineering to production
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 session
 
UVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONUVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATION
 
How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?
 
UVM TUTORIAL;
UVM TUTORIAL;UVM TUTORIAL;
UVM TUTORIAL;
 
UVM Methodology Tutorial
UVM Methodology TutorialUVM Methodology Tutorial
UVM Methodology Tutorial
 
Test automation
Test automationTest automation
Test automation
 
Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...
Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...
Efficient Migration of Verilog Testbenches to 'UVM' Keeping the Functionality...
 
Sw testing
Sw testingSw testing
Sw testing
 
Microcontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-CoreMicrocontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-Core
 
Jonathan bromley doulos
Jonathan bromley doulosJonathan bromley doulos
Jonathan bromley doulos
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic Sequences
 
"Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S...
"Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S..."Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S...
"Man-in-the-SCADA": Anatomy of Data Integrity Attacks in Industrial Control S...
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
 
Agilent flash programming agilent utility card versus deep serial memory-ca...
Agilent flash programming   agilent utility card versus deep serial memory-ca...Agilent flash programming   agilent utility card versus deep serial memory-ca...
Agilent flash programming agilent utility card versus deep serial memory-ca...
 
Understanding and Improving Device Access Complexity
Understanding and Improving Device Access ComplexityUnderstanding and Improving Device Access Complexity
Understanding and Improving Device Access Complexity
 
Uvm presentation dac2011_final
Uvm presentation dac2011_finalUvm presentation dac2011_final
Uvm presentation dac2011_final
 
2008 Asts Technical Paper Protocol Aware Ate Submitted
2008 Asts Technical Paper Protocol Aware Ate Submitted2008 Asts Technical Paper Protocol Aware Ate Submitted
2008 Asts Technical Paper Protocol Aware Ate Submitted
 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification Methodologies
 

Viewers also liked (15)

Storage Device
Storage DeviceStorage Device
Storage Device
 
S emb t2-definition
S emb t2-definitionS emb t2-definition
S emb t2-definition
 
Real time-embedded-system-lec-05
Real time-embedded-system-lec-05Real time-embedded-system-lec-05
Real time-embedded-system-lec-05
 
Real time-embedded-system-lec-06
Real time-embedded-system-lec-06Real time-embedded-system-lec-06
Real time-embedded-system-lec-06
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
Microprocessor based software developnent
Microprocessor based software developnentMicroprocessor based software developnent
Microprocessor based software developnent
 
Mass storage device
Mass storage deviceMass storage device
Mass storage device
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Computer storage devices
Computer storage devicesComputer storage devices
Computer storage devices
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
Embedded System Presentation
Embedded System PresentationEmbedded System Presentation
Embedded System Presentation
 
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
 
Unit 1 embedded systems and applications
Unit 1 embedded systems and applicationsUnit 1 embedded systems and applications
Unit 1 embedded systems and applications
 
Computer memory
Computer memoryComputer memory
Computer memory
 
ppt on embedded system
ppt on embedded systemppt on embedded system
ppt on embedded system
 

Similar to S emb t10-development

39245147 intro-es-i
39245147 intro-es-i39245147 intro-es-i
39245147 intro-es-iEmbeddedbvp
 
Schneider Electric Scada Global Support Provides Troubleshooting and Technica...
Schneider Electric Scada Global Support Provides Troubleshooting and Technica...Schneider Electric Scada Global Support Provides Troubleshooting and Technica...
Schneider Electric Scada Global Support Provides Troubleshooting and Technica...Preeya Selvarajah
 
Dot Net Application Monitoring
Dot Net Application MonitoringDot Net Application Monitoring
Dot Net Application MonitoringRavi Okade
 
ARDUINO BASED HEART BEAT MONITORING SYSTEM
ARDUINO BASED HEART BEAT MONITORING SYSTEMARDUINO BASED HEART BEAT MONITORING SYSTEM
ARDUINO BASED HEART BEAT MONITORING SYSTEMMOHAMMAD HANNAN
 
Microcontroller 8051 timer 274 P$
Microcontroller 8051 timer 274 P$Microcontroller 8051 timer 274 P$
Microcontroller 8051 timer 274 P$PusHkar SaIni
 
01 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa1601 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa16John Todora
 
Drives Software Programming – using PLC or Drive bespoke programming?
Drives Software Programming – using PLC or Drive bespoke programming?Drives Software Programming – using PLC or Drive bespoke programming?
Drives Software Programming – using PLC or Drive bespoke programming?Optima Control Solutions
 
Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...
Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...
Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...IJERA Editor
 
Chapter 4 plc programing(1) by m
Chapter 4 plc programing(1) by mChapter 4 plc programing(1) by m
Chapter 4 plc programing(1) by mGerbawYasgat
 
embedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdfembedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdfYoussefAbobakr
 
Bringing Engineering Analysis Codes Into Real-Time Full-Scope Simulators
Bringing Engineering Analysis Codes Into Real-Time Full-Scope SimulatorsBringing Engineering Analysis Codes Into Real-Time Full-Scope Simulators
Bringing Engineering Analysis Codes Into Real-Time Full-Scope SimulatorsGSE Systems, Inc.
 
Siemens s7 300 programming
Siemens s7 300 programming Siemens s7 300 programming
Siemens s7 300 programming satyajit patra
 
PPT of PLC and SCADA
PPT of PLC and SCADAPPT of PLC and SCADA
PPT of PLC and SCADAMohseen1234
 

Similar to S emb t10-development (20)

S emb t5-arch_io
S emb t5-arch_ioS emb t5-arch_io
S emb t5-arch_io
 
JavaMicroBenchmarkpptm
JavaMicroBenchmarkpptmJavaMicroBenchmarkpptm
JavaMicroBenchmarkpptm
 
39245147 intro-es-i
39245147 intro-es-i39245147 intro-es-i
39245147 intro-es-i
 
Schneider Electric Scada Global Support Provides Troubleshooting and Technica...
Schneider Electric Scada Global Support Provides Troubleshooting and Technica...Schneider Electric Scada Global Support Provides Troubleshooting and Technica...
Schneider Electric Scada Global Support Provides Troubleshooting and Technica...
 
Ch1 1
Ch1 1Ch1 1
Ch1 1
 
Dot Net Application Monitoring
Dot Net Application MonitoringDot Net Application Monitoring
Dot Net Application Monitoring
 
ARDUINO BASED HEART BEAT MONITORING SYSTEM
ARDUINO BASED HEART BEAT MONITORING SYSTEMARDUINO BASED HEART BEAT MONITORING SYSTEM
ARDUINO BASED HEART BEAT MONITORING SYSTEM
 
Training report on embedded sys_AVR
Training report on embedded sys_AVRTraining report on embedded sys_AVR
Training report on embedded sys_AVR
 
Microcontroller 8051 timer 274 P$
Microcontroller 8051 timer 274 P$Microcontroller 8051 timer 274 P$
Microcontroller 8051 timer 274 P$
 
Aniruddha_More_Resume
Aniruddha_More_ResumeAniruddha_More_Resume
Aniruddha_More_Resume
 
01 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa1601 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa16
 
Drives Software Programming – using PLC or Drive bespoke programming?
Drives Software Programming – using PLC or Drive bespoke programming?Drives Software Programming – using PLC or Drive bespoke programming?
Drives Software Programming – using PLC or Drive bespoke programming?
 
Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...
Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...
Implementation of T-Junction Traffic Light Control System Using Simatic S7-20...
 
Chapter 4 plc programing(1) by m
Chapter 4 plc programing(1) by mChapter 4 plc programing(1) by m
Chapter 4 plc programing(1) by m
 
DEVENDRAPLC .pptx
DEVENDRAPLC .pptxDEVENDRAPLC .pptx
DEVENDRAPLC .pptx
 
embedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdfembedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdf
 
Bringing Engineering Analysis Codes Into Real-Time Full-Scope Simulators
Bringing Engineering Analysis Codes Into Real-Time Full-Scope SimulatorsBringing Engineering Analysis Codes Into Real-Time Full-Scope Simulators
Bringing Engineering Analysis Codes Into Real-Time Full-Scope Simulators
 
Honey process manager
Honey   process  managerHoney   process  manager
Honey process manager
 
Siemens s7 300 programming
Siemens s7 300 programming Siemens s7 300 programming
Siemens s7 300 programming
 
PPT of PLC and SCADA
PPT of PLC and SCADAPPT of PLC and SCADA
PPT of PLC and SCADA
 

More from João Moreira

More from João Moreira (11)

Bolt mld1717 11100975
Bolt mld1717 11100975Bolt mld1717 11100975
Bolt mld1717 11100975
 
S emb t12-os
S emb t12-osS emb t12-os
S emb t12-os
 
S emb t11-processes
S emb t11-processesS emb t11-processes
S emb t11-processes
 
S emb t9-arch_power (1)
S emb t9-arch_power (1)S emb t9-arch_power (1)
S emb t9-arch_power (1)
 
S emb t9-arch_power
S emb t9-arch_powerS emb t9-arch_power
S emb t9-arch_power
 
S emb t8-arch_itfio
S emb t8-arch_itfioS emb t8-arch_itfio
S emb t8-arch_itfio
 
S emb t7-arch_bus
S emb t7-arch_busS emb t7-arch_bus
S emb t7-arch_bus
 
S emb t6-arch_mem
S emb t6-arch_memS emb t6-arch_mem
S emb t6-arch_mem
 
S emb t4-arch_cpu
S emb t4-arch_cpuS emb t4-arch_cpu
S emb t4-arch_cpu
 
S emb t1-introduction
S emb t1-introductionS emb t1-introduction
S emb t1-introduction
 
S emb t13-freertos
S emb t13-freertosS emb t13-freertos
S emb t13-freertos
 

Recently uploaded

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

Recently uploaded (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

S emb t10-development

  • 1. Maths is not everything Embedded Systems 5 - Development of microprocessor-based systems Architectures and components Debugging Manufacturing Testing RMR©2012 Example
  • 2. Maths is not everything Development of Microprocessor-based Systems Architectures and Components RMR©2012
  • 3. Software architecture Functional description must be broken into pieces: division among people; conceptual organization; Maths is not everything RMR©2012 © 2008 Wayne Wolf performance; testability; maintenance.
  • 4. Hardware and software architectures Hardware and software are intimately related: software doesn’t run without hardware; Maths is not everything RMR©2012 © 2008 Wayne Wolf how much hardware you need is determined by the software requirements: speed; memory.
  • 5. Software components Need to break the design up into pieces to be able to write the code. Maths is not everything RMR©2012 © 2008 Wayne Wolf Some component designs come up often. A design pattern is a generic description of a component that can be customized and used in different circumstances.
  • 6. Software state machine State machine keeps internal state as a variable, changes state based on inputs. Uses: control-dominated code; Maths is not everything RMR©2012 © 2008 Wayne Wolf reactive systems.
  • 7. State machine specification A in1=1/x=a B r=0/out2=1 r=1/out1=0 in1=0/x=b Maths is not everything RMR©2012 © 2008 Wayne Wolf s=0/out1=0 C D s=1/out1=1
  • 8. C code structure Current state is kept in a variable. State table is implemented as a switch. Cases define states. Maths is not everything RMR©2012 © 2008 Wayne Wolf States can test inputs. Switch is repeatedly evaluated in a while loop.
  • 9. Software design techniques Want to develop as much code as possible on a standard platform: friendlier programming environment; Maths is not everything RMR©2012 © 2008 Wayne Wolf easier debugging. May need to devise software stubs to allow testing of software elements without the full hardware/software platform.
  • 10. Host/target design Use a host system to prepare software for target system: Maths is not everything RMR©2012 © 2008 Wayne Wolf target system host system serial line
  • 11. Host-based tools Cross compiler: compiles code on host for target system. Cross debugger: Maths is not everything RMR©2012 © 2008 Wayne Wolf displays target state, allows target system to be controlled.
  • 12. Evaluation boards Designed by CPU manufacturer or others. Includes CPU, memory, some I/O devices. Maths is not everything RMR©2012 © 2008 Wayne Wolf May include prototyping section. CPU manufacturer often gives out evaluation board netlist---can be used as starting point for your custom board design.
  • 13. Adding logic to a board Programmable logic devices (PLDs) provide low/medium density logic. Maths is not everything RMR©2012 © 2008 Wayne Wolf Field-programmable gate arrays (FPGAs) provide more logic and multi-level logic. Application-specific integrated circuits (ASICs) are manufactured for a single purpose.
  • 14. The PC as a platform Advantages: cheap and easy to get; rich and familiar software environment. Disadvantages: Maths is not everything RMR©2012 © 2008 Wayne Wolf requires a lot of hardware resources; not well-adapted to real-time.
  • 15. Maths is not everything Development of Microprocessor-based Systems Debugging Embedded Systems RMR©2012
  • 16. Debugging embedded systems Challenges: target system may be hard to observe; target may be hard to control; may be hard to generate realistic inputs; Maths is not everything RMR©2012 © 2008 Wayne Wolf setup sequence may be complex.
  • 17. Software debuggers A monitor program residing on the target provides basic debugger functions. Maths is not everything RMR©2012 © 2008 Wayne Wolf Debugger should have a minimal footprint in memory. User program must be careful not to destroy debugger program, but , should be able to recover from some damage caused by user code.
  • 18. Breakpoints A breakpoint allows the user to stop execution, examine system state, and change state. Maths is not everything RMR©2012 © 2008 Wayne Wolf Replace the breakpointed instruction with a subroutine call to the monitor program.
  • 19. ARM breakpoints 0x400 MUL r4,r6,r6 0x400 0x404 ADD r2,r2,r4 0x404 0x408 ADD r0,r0,#1 0x408 0x40c 0x40c B loop Maths is not everything RMR©2012 © 2008 Wayne Wolf uninstrumented code MUL r4,r6,r6 ADD r2,r2,r4 ADD r0,r0,#1 BL bkpoint code with breakpoint
  • 20. Breakpoint handler actions Save registers. Allow user to examine machine. Before returning, restore system state. Maths is not everything RMR©2012 © 2008 Wayne Wolf Safest way to execute the instruction is to replace it and execute in place. Put another breakpoint after the replaced breakpoint to allow restoring the original breakpoint.
  • 21. In-circuit emulators A microprocessor in-circuit emulator is a specially-instrumented microprocessor. Maths is not everything RMR©2012 © 2008 Wayne Wolf Allows you to stop execution, examine CPU state, modify registers.
  • 22. Logic analyzers Maths is not everything RMR©2012 © 2008 Wayne Wolf A logic analyzer is an array of low-grade oscilloscopes:
  • 23. Logic analyzer architecture sample memory UUT system clock microprocessor vector address controller Maths is not everything RMR©2012 © 2008 Wayne Wolf clock gen state or timing mode keypad - Checking memory (e.g. cache misses) or I/O access - Checking execution time (marks needed) display
  • 24. How to exercise code Run on host system. Run on target system. Hardware/Software verification Run in instruction-level simulator. Maths is not everything RMR©2012 © 2008 Wayne Wolf Run on cycle-accurate simulator (e.g. SoC). Run in hardware/software co-simulation environment.
  • 25. Maths is not everything Development of Microprocessor-based Systems Manufacturing RMR©2012
  • 26. Manufacturing testing Goal: ensure that manufacturing produces defect-free copies of the design. Can test by comparing unit being tested to the expected behavior. But running tests is expensive. Maths is not everything RMR©2012 © 2008 Wayne Wolf Maximize confidence while minimizing testing cost. Design for testability take manufacturing test into account during design
  • 27. Testing concepts Yield: proportion of manufactured systems that work. Proper manufacturing maximizes yield. Maths is not everything RMR©2012 © 2008 Wayne Wolf Proper testing accurately estimates yield. Field return: defective unit that leaves the factory.
  • 28. Faults Manufacturing problems can be caused by many things. Fault model: model that predicts effects of a particular type of fault. Maths is not everything RMR©2012 © 2008 Wayne Wolf Fault coverage: proportion of possible faults found by a set of test. Having a fault model allows us to determine fault coverage.
  • 29. Software vs. hardware testing When testing code, we have no fault model. We verify the implementation, not the manufacturing. Maths is not everything RMR©2012 © 2008 Wayne Wolf Simple tests (e.g., Error Correcting Codes) work well to verify software manufacturing. Hardware requires manufacturing tests in addition to implementation verification.
  • 30. Hardware fault models Stuck-at 0/1 fault model: output of gate is always 0/1. Maths is not everything RMR©2012 © 2008 Wayne Wolf 01 0
  • 31. Combinational testing Every gate can be stuck-at-0, stuck-at-1. Usually test for single stuck-at-x faults One fault at a time. Multiple faults can mask each other. We can generate a test for a gate by: controlling the gate’s input; Maths is not everything RMR©2012 © 2008 Wayne Wolf observing the gate’s output through other gates.
  • 32. Sequential testing A state machine is combinational logic + registers. Sequential testing is considerably harder. Maths is not everything RMR©2012 © 2008 Wayne Wolf A single stuck-at fault affects the machine on every cycle. Fault behavior on one cycle can be masked by same fault on other cycles.
  • 33. Scan chains A scannable register operates in two modes: normal; scan---forms an element in a shift register. Maths is not everything RMR©2012 © 2008 Wayne Wolf Using scan chains reduces sequential testing to combinational testing. Unloading/unloading scan chain is slow. May use partial scan.
  • 34. Test generation Automatic test pattern generation (ATPG) programs: produce a set of tests given the logic structure. Maths is not everything RMR©2012 © 2008 Wayne Wolf Some faults may not be testable--redundant. redundancy may have been added for avoiding glitches Timeout on a fault may mean hard-to-test or untestable.
  • 35. Boundary scan Simplifies testing of multiple chips on a board. Registers on pins can be configured as a scan chain (JTAG standard interface) Maths is not everything RMR©2012 © 2008 Wayne Wolf Test Access Port
  • 36. JTAG Also used as an OCDM interface e.g. MSP430 responds to various commands sent over JTAG: Set watchpoint and breakpoint triggers Poll CPU status (e.g., if halted at a breakpoint) Maths is not everything RMR©2012 Poll the state-storage buffer (for information stored at watchpoint trigger) Poll the program counter (PC)
  • 37. Maths is not everything Development of Microprocessor-based Systems Example Designing an Alarm Clock RMR©2012
  • 38. Alarm clock interface Alarm on Alarm off buzzer PM Alarm ready light Maths is not everything RMR©2012 © 2008 Wayne Wolf set time set alarm hour minute button
  • 39. Operations Set time: hold set time, depress hour, minute. Set alarm time: hold set alarm, depress hour, minute. Maths is not everything RMR©2012 © 2008 Wayne Wolf Turn alarm on/off: depress alarm on/off.
  • 40. Maths is not everything RMR©2012 © 2008 Wayne Wolf Alarm clock requirements
  • 41. Alarm clock class diagram 1 Lights* 1 Display 1 1 1 1 Maths is not everything RMR©2012 © 2008 Wayne Wolf Buttons* Speaker* 1 Mechanism 1
  • 42. Alarm clock physical classes RMR©2012 Speaker* digit-val() digit-scan() alarm-on-light() PM-light() Maths is not everything Buttons* set-time(): boolean set-alarm(): boolean alarm-on(): boolean alarm-off(): boolean minute(): boolean hour(): boolean buzz() © 2008 Wayne Wolf Lights*
  • 43. Display class Display Maths is not everything RMR©2012 © 2008 Wayne Wolf time[4]: integer alarm-indicator: boolean PM-indicator: boolean set-time() alarm-light-on() alarm-light-off() PM-light-on() PM-light-off()
  • 44. Mechanism class Mechanism Maths is not everything RMR©2012 © 2008 Wayne Wolf Seconds: integer PM: boolean tens-hours, ones-hours: integer tens-minutes, ones-minutes: integer alarm-ready: boolean alarm-tens-hours, alarm-ones-hours: integer alarm-tens-minutes, alarm-ones-minutes: integer scan-keyboard() update-time()
  • 45. Update-time behavior update seconds with rollover Rollover? display.set-time(current time) F Time >= alarm and alarm-on? T T update hh:mm with rollover Maths is not everything RMR©2012 © 2008 Wayne Wolf alarm.buzzer(true) AM->PM PM=true PM->AM PM=false F
  • 46. Scan-keyboard behavior compute button activations alarm-ready= true Set-time and not set-alarm and hours Alarm-on Maths is not everything RMR©2012 © 2008 Wayne Wolf Alarm-off alarm-ready= false alarm.buzzer(false) Set-time and not setalarm and minutes save button states only one activation Increment time tens w. rollover and AM/PM Increment time ones w. rollover and AM/PM
  • 47. System architecture Includes: periodic behavior (clock); aperiodic behavior (buttons, buzzer activation). Two major software components: Maths is not everything RMR©2012 © 2008 Wayne Wolf interrupt-driven routine updates time; foreground program deals with buttons, commands.
  • 48. Interrupt-driven routine Timer probably can’t handle one-minute interrupt interval. Maths is not everything RMR©2012 © 2008 Wayne Wolf Use software variable to convert interrupt frequency to seconds.
  • 49. Foreground program Operates as while loop: while (TRUE) { read_buttons(button_values); Maths is not everything RMR©2012 © 2008 Wayne Wolf process_command(button_values); check_alarm(); }
  • 50. Testing Component testing: test interrupt code on the platform; can test foreground program using a mock-up. System testing: Maths is not everything RMR©2012 © 2008 Wayne Wolf relatively few components to integrate; check clock accuracy; check recognition of buttons, buzzer, etc.