Well its not actually indefinitely, it will be something like 20ms or its hung.
Denn*** wrote:Now my doubt is that during this erase time (i.e. after the erase command has been issued) for the next 20 ms should I wait there indefinitely till FLASH Command Complete Flag is
The address/data bus is not locked, it is up to the programmer not to make any FLASH accesses during this time. If you do access flash then the result is not defined, possibly a reset, possibly erasing where you did not expect etc etc.
Denn*** wrote:Is the address/data bus locked during this period? If not Then I think I can execute code from RAM.(Code cannot be run from flash while flash erase/programming are to be done right? )Also I have noticed sometime back while flash erasing/programming, an access to the flash part of the code creates reset in HC908GR32.But in HCS908AW32 if I access the operation was getting affected.
I would assume that given enough RAM, then yes you could run a routine there in order to process incoming data, write it to a buffer etc while you are waiting for the erase to complete.
Denn*** wrote:Now my doubt is that during this erase time (i.e. after the erase command has been issued) for the next 20 ms should I wait there indefinitely till FLASH Command Complete Flag is SET or can I do anything useful like executing some critical code.If I wait till 20ms some of my critical code could not be executed(to be frank some data coming from outside into the micro) I'll miss this event.
bigmac wrote:If your ISR code is approaching 2K in size, this is suggestive that your ISR is far too complex, and you are executing code that should optimumly be done outside the ISR. Typically, ISR code should take only a few microseconds to complete.ISR code calls some some functions And this functions are really necessary for the speedy response of for this message.Highly critical! And response should be within 3-4ms ... You can call it is a lengthy ISR since its calling functions within itself. We have to do this inorder to avoid delay in the application response (also MCU response).Protocol based ISR!!!
bigmac wrote:Assuming that there are periods during the operation of your code when a 20 millisecond wait would not be critical, a possible approach is to "pre-erase" one or more flash pages at a non-critical time. Since the write period is much shorter than the erase period, this will probably not represent a problem to your critical code. But you might need to avoid using burst programming mode.
Hardware designs are FREEZED !!!! MCU is HCS908AW32
Regards,
Denn