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
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
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
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