Скачиваний:
38
Добавлен:
27.04.2015
Размер:
3.97 Mб
Скачать

Freescale Semiconductor, Inc.

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Freescale Semiconductor, Inc.

COP and RTI Module

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

11.3.1 COP and RTI Timer Resolution

Table 11-3 shows the resolution and range of the RTI timer for different prescaler clock frequencies.

Table 11-3. COP Timer Range and Resolution

 

Prescaler

RP Prescaler

Resolution

 

Range

 

Frequency

(Preload = 0)

 

(Preload = 28 – 1)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

32.00 kHz

/1

250 ms

 

64 ms

 

(31.25 s)

/4

1 ms

 

 

256 ms

 

 

 

 

 

 

 

 

38.4 kHz

/1

208.3

s

 

53.3 ms

 

(26.04 s)

/4

833.3

s

 

213.3 ms

 

 

 

 

 

 

The RTI occurs every 23 ×

4RP × (DV[7:0] + 1) prescaler clock cycles.

 

The COP time-out occurs every 23 × 4RP ×

(DV[7:0] + 1) × 8(CT + 1) prescaler clock cycles.

11.3.2 COP/RTI Timer Low-Power Operation

The COP/RTI module can be shut off to reduce power consumption when the module is not required by an application. To shut off this module, set the RTE bit in the COPCTL register to 0; see Section 11.2.1, “COP and RTI Control Register (COPCTL).” This gates off all clocks to the COP/RTI module. If either the COP or RTI function is required, the RTE bit must remain set.

It is also possible to run the RTI or COP timer when the chip is in stop mode. When the RTI timer reaches zero, a signal is generated that wakes up the DSP56800 core and brings it out of stop mode. Caution should be taken that the COP timer is not allowed to time out when the DSP56824 is in stop mode. The DSP56824 is reset whenever the COP timer times out, regardless of the operating mode it is in when COP time-out occurs. Both timers can continue to operate in wait mode.

NOTE:

The RTI timer can bring the DSP56824 out of stop mode independently of the value of the RTIE bit in the COPCTL register or of the bits in the IPR (described in Section 3.3.1, “DSP56824 Interrupt Priority Register (IPR),” on page 3-14).

11.3.3 Programming Example

Example 11-1 shows how to set up the COP timer.

11-8 DSP56824 User’s Manual

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Freescale Semiconductor, Inc.

Programming the COP and RTI Timers

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Example 11-1. Sending a COP Reset

;**********************

 

 

;* COP Timer example *

 

 

;* for COP/RTI Module *

 

 

;* of DSP56824 chip

*

 

 

;**********************

 

 

START

EQU

$0040

; Start of program

BCR

EQU

$FFF9

; Bus Control Register

COPCTL

EQU

$FFF1

; COP/RTI Control Register

COPRST

EQU

$FFF0

; COP Reset Register [write-only]

;PCR0 [unused]

EQU

$FFF2

; PLL Control Register 0

PCR1

EQU

$FFF3

; PLL Control Register 1

;**************

 

 

 

;* Vector setup*

 

 

 

;**************

 

 

 

ORG

P:$0000

; Cold Boot

JMP

START

 

; also Hardware RESET vector (Mode 0, 1, 3)

ORG

P:$E000

; Warm Boot

JMP

START

 

; Hardware RESET vector (Mode 2)

ORG

P:$E002

;

JMP

COPOUT

; COP Watchdog RESET vector (Mode 2)

ORG

P:START

; Start of program

;**************

 

 

 

;* General setup*

 

 

 

;**************

 

 

 

MOVEP

#$0000,X:BCR

; External Program memory has 0 wait states.

;External data memory has 0 wait states.

;Port A pins tri-stated if no external access.

COP and RTI Module

11-9

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Freescale Semiconductor, Inc.

COP and RTI Module

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Example 11-1. Sending a COP Reset (Continued)

;****************************

 

;* Prescaler Clock setup *

 

;* (source for divider chain)*

 

;****************************

 

 

MOVEP

#$06C0,X:PCR1

; Configure:

 

 

 

; (PLLE) PLL disabled (bypassed)

 

 

 

; -- Oscillator supplies Phi Clock

 

 

 

; (PLLD) PLL Power Down disabled (PLL active)

 

 

 

; -- PLL block active for PLL to attain lock

 

 

 

; (LPST) Low Power Stop disabled

 

 

 

; (PS[2:0]) Set Prescaler Divider to /256

 

 

 

; (CS[1:0]) Clockout pin (CLKO) disabled

;

[PCR0 unused]

; Feedback Divider unused (PLL bypassed)

;*********************

 

;* COP Timer setup

*

 

;*********************

 

 

MOVEP

#$5555,X:COPRST

; Begin COP reset sequence

 

NOP

 

;

 

MOVEP

#$AAAA,X:COPRST

;

 

NOP

 

;

 

MOVEP

#$5555,X:COPRST

;

 

NOP

 

; COPCTL write-enabled

 

BFCLR

#$0800,X:COPCTL

; (RTE) RTI Timer disabled

 

 

 

; -- COP/RTI divider chain disabled, thus

 

 

 

; -- COP timer (and RTI timer) disabled

 

MOVEP

#$C1FF,X:COPCTL

; Configure:

 

 

 

; (CPE) COP time-out (chip reset) Enabled

 

 

 

; (CT) Set COP Timer divider to /64.

 

 

 

; (RTIE) RTI disabled

 

 

 

; (RTIF) RTI flag remains.

 

 

 

; (RP) Set COP/RTI Prescaler to /4.

 

 

 

; (DV[7:0]) Set COP/RTI Divider to /256.

 

BFSET

#$0800,X:COPCTL

; (RTE) RTI Timer Enabled

 

 

 

; -- COP/RTI divider chain enabled, thus

 

 

 

; -- COP Timer (and RTI Timer) enabled

 

MOVEP

#$AAAA,X:COPRST

; Reset (disable) write mechanism for COPCTL

 

 

 

; and reset COP Timer.

 

NOP

 

; -- End COP reset sequence.

;**************

 

 

;* Main routine*

 

 

;**************

 

; ...

 

 

 

TEST

 

 

; Test Loop

 

 

 

; ...

 

 

 

; code to be watched for potentially wayward

 

 

 

; execution

 

 

 

; ...

 

JSR

COPCLR

; Let the COP know we have not left town.

COPCLR

BRA

TEST

; COP CLEAR -- COP Timer Reset Routine

 

 

 

;******************************************

;* Clear the COP Timer: code execution is still valid* ;******************************************

MOVEP

#$5555,X:COPRST

; Begin COP reset sequence.

NOP

 

;

.

MOVEP

#$AAAA,X:COPRST

;

.

NOP

 

;

.

MOVEP

#$5555,X:COPRST

;

.

NOP

 

; COPCTL write-enabled

MOVEP

#$AAAA,X:COPRST

; Reset (disable) write mechanism for COPCTL

 

 

; and reset COP Timer.

NOP

 

; -- End COP reset sequence.

RTS

 

 

 

11-10 DSP56824 User’s Manual

For More Information On This Product,

Go to: www.freescale.com

 

Freescale Semiconductor, Inc.

 

Programming the COP and RTI Timers

 

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

 

Example 11-1. Sending a COP Reset (Continued)

 

 

COPOUT

; COP time OUT -- COP Watchdog RESET Routine

 

; the COP timed out: system failure has

 

; occurred

 

; ...

 

; error recovery code

 

; ...

 

 

Freescale Semiconductor, Inc.

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

COP and RTI Module

11-11

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

COP and RTI Module

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

11-12 DSP56824 User’s Manual

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Freescale Semiconductor, Inc.

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

Chapter 12

OnCE™ Module

The DSP56824 provides board and chip-level testing capability through two on-chip modules that are both accessed through the JTAG/OnCE port. These modules are as follows:

On-Chip Emulation (OnCE) module

Test access port (TAP) and 16-state controller, also called the Joint Test Action Group (JTAG) port

The presence of the JTAG/OnCE port allows the user to insert a DSP56824 chip into a target system while retaining debug control. This capability is especially important for devices without an external bus, since it eliminates the need for a costly cable to bring out the footprint of the chip, as required by a traditional emulator system. In addition, the JTAG/OnCE port can be used to program the internal flash memory.

NOTE:

The easiest way to program the DSP56824 flash memory is with the use of the DSP56824 Application Development System (ADS). Contact your Motorola sales representative for more information on this product.

The On-Chip Emulation (OnCE) module is a Motorola-designed module used in DSP chips to debug application software. The module is a separate on-chip block that allows non-intrusive interaction with the DSP and is accessible through the pins of the JTAG interface. The OnCE module makes it possible to examine the contents of registers, memory, or on-chip peripherals in a special debug environment. This avoids sacrificing any user-accessible resources to perform debugging.

The capabilities of the OnCE module include the ability to do the following:

Interrupt or break into debug mode on a program memory address (fetch, read, write, or access)

Interrupt or break into debug mode on a data memory address (read, write, or access)

Interrupt or break into debug mode on an on-chip peripheral register access (read, write, or access)

Enter debug mode using a DSP microprocessor instruction

Display or modify the contents of any core or memory-mapped peripheral registers

Display or modify any desired sections of program or data memory

Trace up to 256 instructions

Save or restore the current state of the execution pipeline

Display the contents of the real-time instruction trace buffer (whether in debug mode or not)

Return to user mode from debug mode

Set up breakpoints without being in debug mode

Set hardware breakpoints, software breakpoints, and trace occurrences (OnCE events) that can force the chip into debug mode, force a vectored interrupt, force the real-time instruction buffer to halt, or toggle a pin, based on the user’s needs

OnCE™ Module 12-1

For More Information On This Product,

Go to: www.freescale.com

Соседние файлы в папке DSP568xx