EmbeddedRelated.com
Forums

Why use RAM mode

Started by topandurangs June 29, 2006
--- In l..., "brendanmurphy37"
wrote:
>
> --- In l..., "topandurangs" wrote:
> > from above table,i understand that with RAM mode (MEMMAP = 2), i
will
> > able to locate my all code with interrupt vector in RAM & it
benifit
> me
> > to execute my code fast.
> > I am not sure that how much i am correct.Please correct me if
i am
> in
> > wrong direction.
> > Thanks once again.
> >
> > Regards,
> >
> > Pandurang S.
> > I think you need to get a better understanding of the device
before
> looking at specific registers.
>
> Try http://www.hitex.co.uk/arm/lpc2000book/index.html for a good
> introduction, particularly chapter 3, which covers memory. You
should
> also read the relevant sections of the LPC213x User Manual.
>
> Very briefly:
>
> - The LPC2000 series includes a memory accelerator module (MAM)
that
> speeds up access to Flash.
>
> - As a consequence there is little speed advantage to running from
> RAM. This is in contrast to other ARM7 MCUs (e.g. Oki).
>
> - In general it is much easier to set up the MAM and run from
flash:
> easier because RAM is relatively small; you don't have to load the
> code into RAM; you don't have to mess round with re-locating code
etc.
> etc.
>
> - Running from RAM is however useful if you have a debugger
attached
> to the device: you can load small programs directly through the
JTAG
> in interface, and run them from there. This is faster than re-
flashing
> and you are not restricted in the number of breakpoints you can
set.
>
> - As I said before, the MEMMAP register has nothing to do with
whether
> or not you are running from flash or RAM. You can quite happily
run
> code from RAM with the MEMAP register set to flash. All it does is
map
> 64-bytes from one of several different locations to address zero.
You
> will need to have an understanding of the ARM architecture and
> exception mechanisms to understand why this is useful.
>
> In other words, you probably don't need to run from RAM, except
when
> debugging small sections of code.
>
> I hope this is of some use. One of the problems with non-
proprietary
> controllers is that information can be scattered over several
sources.
> I'd recommend reading at least the introductory material from:
>
> - ARM ARM7TDMI Technical Reference (from ARM)
> - Philips LPC213x User Manual (from Philips)
> - Whatever tool vendor documentation is available (tool dependent)
> - The Hitex book referred to above
> - Examples in the Files section of this Group (in partciular the
> gcc_and_ucosii.zip documentation)
>
> Hopefully, this will be of some help.
>
> Brendan.
>

Hi Brendan,

Thanks for this much help,i well go through the references that
you have given.

Regards,
Pandurang S.

An Engineer's Guide to the LPC2100 Series

--- In l..., "topandurangs" wrote:
>
> Hi all,
>
> With MEMMAP we can select between Flash mode & RAM mode.
> What is the use of RAM mode in ARM7.

Besides just mapping the interrupt vectors into RAM, it makes
interrupts a bit faster because you don't need to access flash - RAM
is faster.
It also gives you the ability to change the vectors when needed.
Some debuggers use this to detect aborts. GDB/Insight will detect
undefined instruction and data/address abort this way.

I tend to copy the vectors into RAM specially during development.
I also test a lot of my code in RAM, that's why the lpc21isp program
will also accept code download into RAM (I don't always carry a JTAG pod).

Be aware however that a watchdog interrupt will reset the lpc and
switch back to the interrupt vectors in Flash so there is no way to
test watchdog operations in this way ...

Regards,

Rob