AnsweredAssumed Answered

MCF51QE Flash and Interrupts

Question asked by sebasira on Nov 13, 2012
Latest reply on Nov 16, 2012 by TomE



I've an application that communicates via SCI @57600bps and writes permanent data in FLASH. It uses a MCF51QE128 running at 25MHz.

I'm using routines from AN3942.


In that document, where it talks about implementation, in the example:


void main(void) {   Clock_init();        // initialization of  clock source on JM128   Flash_Clock_Init();  // initialization of  flash clock frequency   length_data = 10;    // the length of the data is 10 bytes   adress = 0x2000;     // the source data will program to this address   DisableInterrupts;    FlashErase(address);  // erase function    FlashProg(address, source_data, length_data); //program function   EnableInterrupts; }


Before calling FlashErase and FlashProg, interrupts are disabled. I meassure the time, and Erase takes 20mseg. The problem is that this time is sometimes too much for the SCI communication and I lose some characters.


I'm not using any kind of flow control. I guess maybe that's what I should do.


The question is: Does Interrupts MUST be disable? Or can I disable them anywhere else inside FlashErase/Prog so the time that they are disabled is smaller?



Thanks in advance!