#define _iap_DisplayResults #include "__LIB\iap_support.lib" #define testBlockSize 16 dim testBlockPtr, testBlock(testBlockSize), i, valu as integer main: testBlockPtr = addressof testBlock Print "This tests read/write EEPROM IAP commands on the 11U37." while 1 print "==========================================================================" print print "0) Enter a value to initialize a RAM variable contents to" print sprintf("1) Display the RAM variable array's first %d words",testBlockSize) print "2) Write the RAM variable's contents to EEPROM" print sprintf("3) read EEPROM's first %d words into RAM",testBlockSize) print "4) Do a STOP to allow for use of debug tools" print "5) Exit the test app" print print "Enter your selection:" print debugin valu print print sprintf(">> Input Received: %d <<",valu) print select valu case 0 ' Enter a value to initialize a RAM variable contents to print "Enter a value to initialize the RAM variable's contents to:" debugin valu print print sprintf(">> Input Received: %d <<",valu) ' init the ram for i=0 to testBlockSize testBlockPtr(i) = valu next case 1 ' Display the RAM variable array's first %d words print print sprintf("RAM variable array's first %d words:%c",testBlockSize,chr(10)) i = testBlockPtr while i < testBlockPtr + testBlockSize*4 print sprintf ("0x%08X %d",i,*i) i += 4 loop case 2 ' Write the RAM variable's contents to EEPROM iap_writeEEPROM(0x000, testBlockSize*4, testBlockPtr) case 3 ' read EEPROM's first %d words into RAM iap_readEEPROM(0x000, testBlockSize*4, testBlockPtr) case 4 ' Do a STOP to allow for use of debug tools print print ">> stopping for debug<<" stop case 5 ' Exit the test app exit case else print ">> Bad Selection - try again... <<",valu endselect print print ">> Done <<" loop print print ">> Goodbye <<" end