AN3741 FLASH data writing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

AN3741 FLASH data writing

1,048件の閲覧回数
Anonymous
適用対象外


Dear All,

 

Anybody tried flash writing with RS08LA8?

Please see the attachment . I unable to find my mistake.

Original Attachment has been moved to: FlashRS08.rar

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

845件の閲覧回数
kef2
Senior Contributor V

Did you apply proper voltage on Vpp pin? IMO Vpp requirement is a showstopper for apps, which need In Application flash Programming. There are better MCU alternatives more suited for IAP.

Regards,

Edward

0 件の賞賛
返信

845件の閲覧回数
Anonymous
適用対象外

Thanks for reply. I have verified HW OK. I could not understand properly to use this application notes.

I used following line for write data buffer at memory location 0x2000 in FASH. Is this correct?

    

data[0]=0x55;

data[1]=0x55;

data[2]=0x55;

     

     

      prog_ram[20] = (unsigned char)&data; // ensure that _data in direct page

                                            // otherwise prog_ram[17] must

                                            // be updated either.

     

      __asm JSR prog_ram;

  

  

Thanks

0 件の賞賛
返信

845件の閲覧回数
kef2
Senior Contributor V

Yes, seems being correct. But AN3741 code won't work if you selected minimal startup code in project wizard.  You need ANSI startup routine to make prog_ram[] initialized properly at startup. Else you need to provide your own routine, which will fill prog_ram codes.

Hope there are no differences in LA8 vs KA8 programming algorithms, perhaps no. If you want to roll out your own C routine to program flash, which of course needs to be placed in RAM, here's how to make RS08 RAM function with CW:

1. In project wizard chose ANSI startup

Since faster to access RAM at 0x50 is precious thing, I'm going to put RAM function to "far" RAM at >=0x100.

2. Add to compilers command line arguments string settings  -D__STARTUP_USE_FAR_POINTERS

This will make ANSI startup routine able to initialize RAM variables at >0xFF

3. Add to linkers command line arguments string -NoSectCompat

This will make linker not complaining about code in RAM.

4. Edit PRM file. Add to PLACEMENT block following line

     CODE_RAM                INTO RAM1;

Now in C code you need to round your RAM function with pragmas like this

#pragma CODE_SEG __FAR_SEG CODE_RAM

void myfunctioninram(void) {

}

#pragma CODE_SEG DEFAULT

Hope this helps.

Edward

0 件の賞賛
返信