4.8 Accessing the I-7188XC(D) Memory
4.8.1 Using Flash Memory
The I-7188XC(D) module contains 256K 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:
int data=0xAA55, data2;
char *dataptr;
int *dataptr2;
InitLib(); /* Initiate the 7188xc 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);
/* read data from the Flash memory method 2 */
dataptr2=(int far *)_MK_FP(0xd000, 0x1234);
data=*data
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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
61
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...