EE342_Rev1| Application Note

EE342_Rev1 PDF

EE342_Rev1| Application Note


Engineer-to-Engineer Note

EE-342

a

Technical notes on using Analog Devices DSPs, processors and development tools
Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors or e-mail processor.support@analog.com or processor.tools.support@analog.com for technical support.

Loop Resource Manipulation for SHARC Processors
Contributed by Jagadeesh Rayala and Saurbh Srivastava Rev 1 June 12, 2008

Introduction
The ADSP-2136x SHARC Processor Programming Reference[1] prohibits any modification of the loop resources, such as the PCSTK, LPSTK, and CURLCNTR register within the loop (including subroutines and ISRs starting from a loop) as this may adversely affect the proper functioning of the looping operation for reasons described below. Short loops 1, 2, or 3 instructions in the loop body with small iteration count are handled differently in hardware compared to other loops. The exact characterization of the loop short or otherwise is determined when the loop startup instruction (DO ... UNTIL LCE) is executed and retained during execution of the loop. Unfortunately, this information is not stored in a state register that is popped and pushed along with LPSTK and PCSTK. During normal nesting of the loops within a short loop, hardware recreates this information based on the stack values. In summary, popping and pushing LPSTK and PCSTK with new values, generally interferes with proper functioning of loops. Howe
ver, popping and pushing of loop and PC stack to temporarily vacate the stacks can still be performed such that this information is recreated automatically by following the procedure described in the next section. The steps outlined in this EE Note to pop and push loop/PC stacks inside an active loop apply for ADSP-2136x and ADSP-2137x SHARC Processors only.

Popping and Pushing LPSTK and PCSTK inside an Active Loop
Follow this sequence to pop and push LPSTK and PCSTK inside an active loop to temporarily vacate the stacks: 1. Pop LPSTK and PCSTK after storing the value of CURLCNTR, LADDR, and PC. 2. Use the empty entry/entries of stacks. 3. Recreate the loops by performing the following steps in the prescribed sequence: a. Push LPSTK. b. Load the value of CURLCNTR. c. Load the LADDR.

Copyright 2008, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers' products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices Engineer-to-Engineer Notes.


EE342_Rev1 Application Note analog Download PDF

Add this permalink to your bookmarks for future download of EE342_Rev1 ApplicationNote

Permalink: http://application.emcelettronica.com/analog/EE342_Rev1

PDF EE342_Rev1 APPLICATION NOTE