cancel
Showing results for 
Search instead for 
Did you mean: 

VM reg & page register value

babidesai123
Associate II
Posted on January 06, 2004 at 15:27

VM reg & page register value

4 REPLIES 4
sbencke3
Associate II
Posted on May 17, 2011 at 11:53

How can I change the Page Register using C ?

babidesai123
Associate II
Posted on May 17, 2011 at 11:53

Hello,

We are trying to implement IAP code for upsd323x . in that we have mapped boot flash as code &

primary flash as data.

primary flash FS0 -0000--- 7FFF h page 0

primary flash FS1 -0000--- 7FFF h page 1

primary flash FS2 -0000--- 7FFF h page 2

Now when we are trying to switch the block from secondary to primary , using VM & page register we are ablr to achieve that,.

but the reverse case it is not happening.

I would like to know whether this is happening because of page register??

For more details, i am attaching the assembly code of simple block switching routine.

Purvi

joseph2399
Associate II
Posted on May 17, 2011 at 11:53

In order to do a seamless transition from the Boot Flash to Main Flash and vice versa, the address location of your code in the Boot Flash memory must be located identically in the Main Flash memory as well. This is needed since the MCU doesn't know anything about the memory swap, it just keeps on generating address and the memory provides the instruction. After the instruction that writes to the PAGE register, the MCU generates the next sequential address. The code fetch from this next address in memory 2 must be the same as if it were occurring from memory 1. This results in the microcontroller executing seamlessly without knowledge of the swap.

Also, you need to keep your Stacks at the same locations in both code bundles.

sbencke1
Associate II
Posted on May 17, 2011 at 11:53

Dear Moderator,

I understand that when I switch from one block to other I need to have the same adress memory and the same stack, but how can I do this (using C) if I have a different programs in each block?

There is a way to jump to code adress 0x0000 before change de VM value, or put a function in a particular adress?