cancel
Showing results for 
Search instead for 
Did you mean: 

problem in block switching

babidesai123
Associate II
Posted on April 23, 2003 at 12:34

problem in block switching

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

Hello,

We are facing some problems in block switching from secondary to primary & viceversa.

Details:

Configuration in PSD SOFT EXPRESS:

rs0: 8000 87FF

CSIOP: 5200 52FF

FS0: 0000 3FFF PAGE0 DATA SPACE

FS1: 0000 3FFF PAGE 1

CSBOOT0: 0000 1FFF CODE SPACE

CSBOOT1: 2000 3FFF

CSBOOT2: 4000 5FFF

CSBOOT3: 6000 7FFF

WHILE SWITCHING THE BLOCK, WE ARE WRITTING TO PAGE REG & VM REGISTER .

& THEN

ljmp 0x0000

eg.switching from primary to secondary/ boot memory block

mov dptr,#0x52e0 ; Accessing the page register

mov a,#0x00 ;

movx @dptr,a

mov dptr,#0x52e2 ; Accessing the VM register

mov a,#0x12 ;JUMP TO SEC FLASH (primary=data, sec=code)

movx @dptr,a

ljmp 0x0000 ; location to start the second routine

but with this we are not able to jump to secondary.at loaction 0x0000

if we write poweron(main initialization) routine above org 0x0290

then only we are able to switch the block.

I would like to know the reason behind this!!

Since we are trying to write iap code in C ( resides in secondary )

in C we are finding difficult to write function at absolute address.

PlZ help!

yu-jun
Associate II
Posted on May 17, 2011 at 11:53

switching from primary to secondary/ boot memory block

mov dptr,#0x52e0 ; Accessing the page register

mov a,#0x00 ;

movx @dptr,a

mov dptr,#0x52e2 ; Accessing the VM register

mov a,#0x12 ;JUMP TO SEC FLASH (primary=data, sec=code)

movx @dptr,a

ljmp 0x0000 ; location to start the second routine

All goal Hex get from all above code must be in the same address in the first/secound page.
babidesai123
Associate II
Posted on May 17, 2011 at 11:53

sorry i couldn't get ..what you mean by 'must be in the same address in the first/second page.

what more i have tried is. i wrote the same code in both the blocks(primary as well as boot block)then without specifying the org it works.

but if i write the same code in priomary block fs1 then it's not able to come back from that block.

IS IT SOMETHING THAT BLOCK SWITCHING ROUTINE HAS TO BE IN THE SAME ADDRESS SPACE(HEX LOCATION) FOR ALL THE BLOCKS WE USE(FS0,FS1,CSBOOT0)????

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

THANKS ALOT!!!

IT WORKS FINE WITH THIS..

is there any means to put the C functions at some particular address(absolute address)??

So that the block switching functions, we can put to some common address space.

With assembly language it is quite easy.

but IAP code is written in C & application code is in assembly.

Once again thanks lot!