![background image](http://html1.mh-extra.com/html/icp-das-usa/i-7188xb-series/i-7188xb-series_user-manual_3585678061.webp)
4.8 Accessing the I-7188XB(D) Memory
4.8.1 Using Flash Memory
The I-7188XB(D) module contains 512K bytes of Flash memory which
includes space reserved for the MiniOS7. The MiniOS7 occupies the
0xF000 segment. So user can use the other segments whose total size
is 448K bytes.
Each bit of the Flash memory can only be written from 1 to 0 and cannot
be written from 0 to 1. The only way to change the data from 0 to 1 is to
call the
EraseFlash()
function to erase a block from the Flash Memory
(64K bytes). The user should decide whether to write to the block or to
erase it.
To write an integer to segment 0xD000, offset 0x1234 of the Flash
Memory, the code is as follows:
/* read data from the Flash memory method 2 */
dataptr2=(int far *)_MK_FP(0xd000, 0x1234);
data=*data
int data=0xAA55, data2;
char *dataptr;
int *dataptr2;
InitLib(); /* Initiate the 7188xb library */
dataptr=(char *)&data;
FlashWrite(0xd000, 0x1234, *+);
FlashWrite(0xd000, 0x1235, *dataptr);
/* read data from the Flash Memory method 1 */
dataptr=(char *)&data2;
*dataptr=FlashRead(0xd000, 0x1234);
*(1)=FlashRead(0xd000, 0x1235);
Reading data from the Flash Memory is somewhat like reading data
from SRAM. The user should allocate a far pointer to point to the
memory location first, and then use this pointer to access the memory.
I-7188XB Series User’s Manual(Ver.1.0, Apr/2007,
7MH-020-10
) ---
61
Summary of Contents for I-7188XB Series
Page 88: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 88...
Page 138: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 138...
Page 144: ...Step 8 Make the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 144...
Page 151: ...Step 8 Rebuild the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 151...