AnsweredAssumed Answered

ADuC7061 problem with erasing FLASH and ADC data

Question asked by faziczeq_PL on Feb 2, 2017
Latest reply on Feb 9, 2017 by MLambe


i have a problem with ADC data after i erasing FLASH. 



int FLASH_Erase_Page(uint16_t data_adr)
FEEMOD |= FEEMOD_ERnWR; // Bit 3 should be set to allow erase/write command, of the 16-bit FEEMOD register

FEEADR = data_adr; // Load the data adress page given, to the FEEADR 16-bit register
FEECON = FEECON_SINGLE_ERASE; // Erase the page indexed by FEEADR
status = FEESTA&0x03; // Get the status of the first 2 bits of the flash control interface register FEESTA, indicating a command pass or fail
while (!(status)) status = FEESTA&0x03; // Wait until the command given above is completed successfully or failed
if ((status&0x02)==0x02) // Checking the bit 1 of the FEESTA register, indicating that a command failed
error = FLASH_ERROR_COMMAND_FAIL; // If the command had failed then produce an error
FEEMOD &= ~FEEMOD_ERnWR; // Clear the Bit 3 stop erase/write commands

} // END OF FLASH_Erase_Page()


after this command when i want to erase address 0x7600 per 3 seconds i have wrong data from ADC. After 3 seconds everything going back.


What am i doing wrongly ? Do you have any suggestion ?? error on ADC is on 0x3000 level in ADC0DAT when amplifier is 128.