<< Chapter < Page Chapter >> Page >
Large amounts of data can be stored in external memory. The READPROG and WRITPROG macros copy data between internal memory and external memory.

Introduction

The TI DSP evaluation boards you use have a large amount of memory; in addition to the 32K words internal to the DSP,there are another 256K words of memory installed on the EVM board. For many exercises, the data sets are small, and youworked with only the on-chip memory of the DSP and were not expected to consider how the use of memory impactedperformance. However, the large delays often required in audio processing, for example, require that many thousands ofsamples be stored in memory. There is not enough memory on the DSP microprocessor itself to store a second or more of samplesat a 44.1 kHz sample rate, so the off-chip memory must be used.

Evm memory maps

As you have seen, the TI TMS320C54x DSP has two separate memory spaces, called Program and Data. Usually, Programcontains your assembled program, and Data contains data, but sometimes it may be convenient or more efficient to violatethis convention. (For instance, the firs instruction requires filter coefficients in the Program address space.) The Data space is 64K long and is accessedusing the 16-bit auxiliary registers ( ARx ). Although the Program space is normally accessed using 16-bit literals stored in your program code,the Program space is, in fact, significantly larger than 64K. Using special "extended addressing" instructions, the TI DSPcan access up to 8192K-words of memory in the Program space. The extended addressing instructions include far calls andjumps that reset the full 23-bit program counter, as well as accumulator-addressed data-transfer instructions.

Internal and external memory

In many exercises, it is possible to store program instructions and data entirely in the DSP's on-chip("internal") memory. This internal memory has several advantages over off-chip ("external") memory: it is muchfaster (data stored can be accessed without delay), and multiple reads and writes can access the DSP's on-chipmemory simultaneously. However, many applications (including the audio delay effect of Using External Memory ) require a data buffer too large to fit into the on-chip memory. For these large buffers, wemust use the larger but slower external memory.

When writing programs that require large amounts of memory, use the internal memory to hold your code, filtercoefficients, and any small buffers you need. External memory should be used for large buffers that you only accessa few times per sample, like the delay buffer described in Audio Effects: Using External Memory .

Tms320c549x dsp evm memory maps

DSP EVM memory maps

As these memory maps show, the EVM's Data address space is addressed fully by the 16-bit auxiliary registers( ARx ) and address-extension words and the mapping of Data memory is not affected by the OVLY bit. However, because the Program memory space is much larger than can be addressed by the 16-bitaddressing register or the 16-bit literals stored in the program, it is split up into 64K (16-bit) pages by thehardware. Normal instructions, such as call , firs , and mvpd accept only 16-bit addresses, and can therefore only address the current "page"(usually address in the form 00xxxxh , which corresponds to the addresses the linker uses for yourprogram's code). To access the full 23-bit address space, the DSP offers special accumulator-addressed load, store,and jump instructions.

Further complicating matters is the fact that the OVLY bit affects the mapping of the Program memory space. If you remember, before we load our DSPprogram, we have to change the PMST to FFE0h . We do this to set the OVLY bit in the PMST , which maps the internal memory into both the Program and Data spaces of the DSP. If OVLY is 1, the internal memory appears in both the Data and Program memory address space at locations 0080h to 07FFFh . Therefore, with OVLY set, anything written into Data memory below 07FFFh will overwrite a program stored in the same location.

This is why the memory allocated for your program - 6000h - 7FFFh - does not overlap with any of the space allocated for the datasegments.
In addition, copies of the internal memory also appear in the extended Program address space, occupyinglocations 0080h - 7FFFh of each page. Therefore, with OVLY set, any addresses to Program memory locations in the form of xx0000h - xx7FFFh reference internal memory.

When OVLY is zero, internal memory is not mapped into the Program space at all; in this case, theProgram space includes only external memory. In this mode, all 192K words of external Program RAM are accessible,although several wait states will be required for accessing each item of memory. In the overlay mode, only addresses inthe ranges of 08000h - 0FF00h , 1800h - 1FFFFh , and 28000h - 2FFFFh are available to store your data buffers; the remaining addresses areunmapped or map to the on-chip RAM.

To escape this confusion and allow the full 192K-words of external Program RAM to be used for your data buffers, thecore file provides mechanisms for manipulating the PMST indirectly. Instead of accessing the external Program RAM directly, we can use the special macrosto access the RAM that is normally "hidden" by the internal memory. This allows us to use the full range of externalmemory available: addresses 000000h - 00FF00h and 010000h - 02FFFF . However, since addresses 00FF00h - 00FFFFh are reserved by the core file, you must be careful not to writeto addresses in this range.

Accessing extended program ram

The core file provides two macros for accessing data stored in the external Program RAM: READPROG and WRITPROG . These macros allow the processor to copy data between data memory and external Programmemory. Both macros address external Program memory using the value in accumulator A . READPROG reads data from the external Program memory location pointed to by A and writes it to the data memory location pointed toby AR1 . WRITPROG reads data from the memory location pointed to by AR1 and writes it to the location in external Program RAM specified byaccumulator A . Both macros take one parameter, a count; specifying 1 reads or writes one word from externalmemory, and specifying some other number n transfers n words starting at the locations pointed to by A and AR1 . AR1 is left pointing at the word after the last word read or written; noother registers are modified.

For instance, the following code fragment loads the value contained in memory location 023456h into the location 0064h in data memory using the READPROG macro:

1 stm #64h,AR1 ; load 64h into AR1 2 ld #02h,16,A ; load 02h in high part of A 3 adds #3456h,A ; fill in low part of A 4 ; A contains 023456h 5 READPROG 1 ; read from 023456h in external Program RAM 6 ; into *AR1 in Data RAM

The WRITPROG macro can be used similarly to write into extended Program RAM:

1 stm #64h,AR1 ; load 64h into AR1 2 ld #02h,16,A ; load 02h in high part of A 3 adds #3456h,A ; fill in low part of A 4 ; A contains 023456h 5 WRITPROG 1 ; write from *AR1 in Data RAM to 6 ; 023456h in external Program RAM

Note that Code Composer will not display or allow you to change the contents of the external Program RAM on thememory-dump or disassembly screen, though you can view or change it indirectly by watching the effects of the READPROG and WRITPROG macros on data memory.

Questions & Answers

Three charges q_{1}=+3\mu C, q_{2}=+6\mu C and q_{3}=+8\mu C are located at (2,0)m (0,0)m and (0,3) coordinates respectively. Find the magnitude and direction acted upon q_{2} by the two other charges.Draw the correct graphical illustration of the problem above showing the direction of all forces.
Kate Reply
To solve this problem, we need to first find the net force acting on charge q_{2}. The magnitude of the force exerted by q_{1} on q_{2} is given by F=\frac{kq_{1}q_{2}}{r^{2}} where k is the Coulomb constant, q_{1} and q_{2} are the charges of the particles, and r is the distance between them.
Muhammed
What is the direction and net electric force on q_{1}= 5µC located at (0,4)r due to charges q_{2}=7mu located at (0,0)m and q_{3}=3\mu C located at (4,0)m?
Kate Reply
what is the change in momentum of a body?
Eunice Reply
what is a capacitor?
Raymond Reply
Capacitor is a separation of opposite charges using an insulator of very small dimension between them. Capacitor is used for allowing an AC (alternating current) to pass while a DC (direct current) is blocked.
Gautam
A motor travelling at 72km/m on sighting a stop sign applying the breaks such that under constant deaccelerate in the meters of 50 metres what is the magnitude of the accelerate
Maria Reply
please solve
Sharon
8m/s²
Aishat
What is Thermodynamics
Muordit
velocity can be 72 km/h in question. 72 km/h=20 m/s, v^2=2.a.x , 20^2=2.a.50, a=4 m/s^2.
Mehmet
A boat travels due east at a speed of 40meter per seconds across a river flowing due south at 30meter per seconds. what is the resultant speed of the boat
Saheed Reply
50 m/s due south east
Someone
which has a higher temperature, 1cup of boiling water or 1teapot of boiling water which can transfer more heat 1cup of boiling water or 1 teapot of boiling water explain your . answer
Ramon Reply
I believe temperature being an intensive property does not change for any amount of boiling water whereas heat being an extensive property changes with amount/size of the system.
Someone
Scratch that
Someone
temperature for any amount of water to boil at ntp is 100⁰C (it is a state function and and intensive property) and it depends both will give same amount of heat because the surface available for heat transfer is greater in case of the kettle as well as the heat stored in it but if you talk.....
Someone
about the amount of heat stored in the system then in that case since the mass of water in the kettle is greater so more energy is required to raise the temperature b/c more molecules of water are present in the kettle
Someone
definitely of physics
Haryormhidey Reply
how many start and codon
Esrael Reply
what is field
Felix Reply
physics, biology and chemistry this is my Field
ALIYU
field is a region of space under the influence of some physical properties
Collete
what is ogarnic chemistry
WISDOM Reply
determine the slope giving that 3y+ 2x-14=0
WISDOM
Another formula for Acceleration
Belty Reply
a=v/t. a=f/m a
IHUMA
innocent
Adah
pratica A on solution of hydro chloric acid,B is a solution containing 0.5000 mole ofsodium chlorid per dm³,put A in the burret and titrate 20.00 or 25.00cm³ portion of B using melting orange as the indicator. record the deside of your burret tabulate the burret reading and calculate the average volume of acid used?
Nassze Reply
how do lnternal energy measures
Esrael
Two bodies attract each other electrically. Do they both have to be charged? Answer the same question if the bodies repel one another.
JALLAH Reply
No. According to Isac Newtons law. this two bodies maybe you and the wall beside you. Attracting depends on the mass och each body and distance between them.
Dlovan
Are you really asking if two bodies have to be charged to be influenced by Coulombs Law?
Robert
like charges repel while unlike charges atttact
Raymond
What is specific heat capacity
Destiny Reply
Specific heat capacity is a measure of the amount of energy required to raise the temperature of a substance by one degree Celsius (or Kelvin). It is measured in Joules per kilogram per degree Celsius (J/kg°C).
AI-Robot
specific heat capacity is the amount of energy needed to raise the temperature of a substance by one degree Celsius or kelvin
ROKEEB
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Digital signal processing laboratory (ece 420). OpenStax CNX. Sep 27, 2006 Download for free at http://cnx.org/content/col10236/1.14
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital signal processing laboratory (ece 420)' conversation and receive update notifications?

Ask