Alfredo Cabral

HCS08 Flash Erase/Write Routines.

Discussion created by Alfredo Cabral on Apr 14, 2006
Latest reply on Apr 1, 2007 by Robert Bailey
I attached the AN2295 and Standard Software SGF Driver for HCS08 flash routines prepared for simple use.
What you need to do:
-Add FlashRoutines.asm to your user modules.
-Include flash.h in the file where you are to use the routines.
-Modify BUS_CLK value to the programed bus in your application.
-Modify INCLUDE "" in FlashRoutines.asm to accommodate the derivative in your application.
This is some example code:
const unsigned char text[]="This is some text";
  asm sei;
  returnCode = FlashInit(FLASH_CLK);
  Erase_Page((unsigned char *)0x8000);
  Write_Flash((unsigned char *)0x8000,17,&text[0]);
  asm cli;
Message Edited by t.dowe on 2009-09-04 02:21 PM