Can anyone help with assembler code to program Flash from within the application.

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

Can anyone help with assembler code to program Flash from within the application.

ソリューションへジャンプ
1,145件の閲覧回数
cwt
Contributor II

Can anyone help with assembler code to program Flash from within the application. I have used routines from AN3942 and HCS08 reference manual.  I have entered sub routines "FlashErase1", "FlashProg1", "DoOnStack", and "SpSub".  But I am not sure how to pass the memory address and the data when calling these routines.

Thanks

Bill

ラベル(1)
0 件の賞賛
返信
1 解決策
1,000件の閲覧回数
tonyp
Senior Contributor II

I don't know about the particular application note but usually address is passed in the HX register and data in the A register.

(You can also have a look at my ASM8​​ version inside the ZIP archive file code/lib/flash.sub, or here: http://aspisys.com/code/hc08/flash.html​ to get an idea.)

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,001件の閲覧回数
tonyp
Senior Contributor II

I don't know about the particular application note but usually address is passed in the HX register and data in the A register.

(You can also have a look at my ASM8​​ version inside the ZIP archive file code/lib/flash.sub, or here: http://aspisys.com/code/hc08/flash.html​ to get an idea.)

0 件の賞賛
返信
1,000件の閲覧回数
cwt
Contributor II

Tony,

Thanks for the reply. Your 'flash.sub' will take me some time to digest.  It looks similar to the App note but more comprehensive.

I tried running mine in CodeWarrior simulator, but it never exits the subroutine running on the stack. I guess this is because the simulator cannot actually simulate the flash memory erase or write.  There seams to be some time critical operations (flash clock has limited range) and this probably limits the use of Back Ground Debug operation as well. Any comment?

Bill

0 件の賞賛
返信