/* Flash-r.c: To read the data from the Flash memory. Compiler: BC++ 3.1, Turbo C++ 1.01 (3.01) MSVC 1.52 Compile mode: Large Project: Flash-r.c ..\..\Lib\upac5000.lib Hordware: uPAC-5000 Description The uPAC-5000 module contains 512K bytes of Flash memory which includes spaces reserved for the MiniOS7. The MiniOS7 occupies the 0xF000 segment. So user can use the other segments whose total size is 448K bytes. [Dec 28, 2011] by Liam */ #include #include #include #include "..\..\lib\upac5000.h" void main(void) { int data; unsigned e=0x9000, i=0; char c; InitLib(); while(i<65535) { FlashRead(e, i); Print("\r\nThe value which segment %u of Flash Member is %d", i, FlashRead(e, i)); i++; if(i%100==0) { Print("\r\nPress q to quit or any key to continue..."); c=Getch(); if((c=='q') || (c=='Q')) return; } } }