Storing data in FLASH - MC68HC908QY4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Storing data in FLASH - MC68HC908QY4

902 Views
Gaz250587
Contributor I
Hi,
 
I know there are a few posts already on this sort of topic but im still finding myself a bit stuck!!
 
In my application, I need to store a 128 bits in FLASH memory.
 
I tried to use 
as an example (obviously changing things to suite the MC68HC908QY4 MCU address ranges and registers etc.)
 
For a test code I'm just trying to write a random variable to a FLASH address and then read it and display on LEDs after pressing a button(using InDart dev board) but its not doing anything apart from displaying 0xFF.
 
Does anyone know any good links or have some examples of some code?
If it will help I can post the code I have used. I hope i'm not being too vague!!
 
Any help would be appreciated as this is driving me nuts!


Message Edited by Gaz250587 on 2008-04-23 10:14 AM

Message Edited by Gaz250587 on 2008-04-23 10:14 AM
Labels (1)
0 Kudos
1 Reply

205 Views
bigmac
Specialist III
Hello,
 
For small HC908 devices, such as the QY4(A), you should consider using the in-built ROM resident routines, specifically to erase and program flash data memory.  You will find that this may make life much easier.  Refer to AN2874 and AN2635 for details.
 
To handle a total of 128 bytes of non-volatile data, this will occupy two 64-byte flash pages.  However, when using the ROM routines, the maximum number of bytes that may be programmed for a single call is limited to a single row of  32 bytes.  The ROM routines make use of a RAM buffer to hold the data to be programmed, and this must start at a specific location.  If a whole row is to be programmed, the buffer will occupy 32 bytes, plus four additional bytes.
 
Regards,
Mac
 
0 Kudos