2004-01-06 06:27 AM
2011-05-17 02:53 AM
How can I change the Page Register using C ?
2011-05-17 02:53 AM
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. Purvi2011-05-17 02:53 AM
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.2011-05-17 02:53 AM
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?