M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial...

9
m Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE - To explain how to configure and use the Computer Operating Properly (COP) Module in common applications OBJECTIVES: - Describe the uses and features of the COP Module. - Identify the steps to configure and service the COP Module. - Describe methods for protecting the system from runaway software. CONTENT: - 9 pages - 1 question LEARNING TIME: - 10 minutes PREREQUESITE: - Training modules: 68HC08 CPU, Resets and Interrupts

Transcript of M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial...

Page 1: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #1 of 7

Tutorial Introduction

PURPOSE

- To explain how to configure and use the Computer Operating Properly (COP) Module in common applications

OBJECTIVES:

- Describe the uses and features of the COP Module.

- Identify the steps to configure and service the COP Module.

- Describe methods for protecting the system from runaway software.

CONTENT:

- 9 pages

- 1 question

LEARNING TIME:

- 10 minutes

PREREQUESITE:

- Training modules: 68HC08 CPU, Resets and Interrupts

Page 2: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #2 of 7

Uses and Features

• Free-running counter cleared by user code.

• Provides system protection.

• Allows the CPU to recover to a known state after unexpected events:

• Runaway software

• Software processing errors

• Includes a selectable timeout period.

• COP resets if not serviced within the timeout period.

Page 3: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #3 of 7

Prescaler

12-BIT COP PRESCALER

CL

EA

R A

LL

ST

AG

ES

CL

EA

R S

TA

GE

S 5

-12

COP CLOCK

COP MODULE

CGMXCLK

STOP INSTRUCTION

INTERNAL RESET SOURCES

RESET VECTOR FETCH

COPCTL WRITE

Frequency = Crystal Frequency

CGMXCLK

Clears COP Prescaler

STOP INSTRUCTION

Power-OnCOP

Low Power - LVIIllegal OpcodeIllegal Address

INTERNAL RESET SOURCES

Vector addressappears on data bus

RESET VECTOR FETCH

Clears COP Counter

COPCTL WRITE

Page 4: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #4 of 7

• Free-counter that generates a reset if allowed to overflow.

• Timeout period is selectable with the COPRS bit

12-BIT COP PRESCALER

6-BIT COP COUNTER

Block Diagram12-BIT COP PRESCALER

COP CLOCK

COP MODULE6-BIT COP COUNTER

CLEAR COP

COUNTER

RESET CIRCUIT

RESET STATUS REGISTER

CO

P T

IME

OU

T

COPEN (from SIM)

COPD (from CONFIG)

RESET

COPCTL WRITE

COPRS (From CONFIG)

COPD (from CONFIG)

0

1

COP Module Enabled

COP Module Disabled

0

1

COP Timeout Period = 213 - 24 CGMXCLK Cycles

COP Timeout Period = 218 - 24 CGMXCLK Cycles

COPRS (From CONFIG)1

Page 5: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #5 of 7

Refresh rate depends on CGMXCLK frequency

• COP must be serviced within:

• Example: 4 MHz external crystal (CGMXCLK = 4 MHz)

4000000

8192 * 320.065536 seconds

or 65.53 ms

~~

CGMXCLK frequency

8192 * 32Seconds

Reset Rate Example

12-bit Cop Prescaler = 213 5-bit Cop Prescaler = 25

Page 6: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #6 of 7

COP Control Register (COPCTL)

• Clears COP counter

• Clears bits 12 through 4 of the SIM Counter

• Prevents reset

• Starts new timeout period

Page 7: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #7 of 7

System Protection Methods

• Use one instruction, or one section of code, to refresh the COP.

• Include refresh instructions in main code loop.

• Avoid using in subroutines.

• Avoid using in timer or interrupt routines.

• Service COP within the minimum timeout period.

• See the technical data book for more information.

Page 8: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #8 of 7

Question

Which clock source is used as the input to the COP counter?

a) Internal output of the PLL

b) Crystal frequency

c) Bus frequency

d) User-selectable

Page 9: M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.

mSemiconductor Products Sector

Computer Operating Properly Module DetailSlide #9 of 7

Tutorial Completion

- COP Uses and Features - COP Configuration and Servicing- System Protection Methods