Page 1 of 1

How does AMC burn flash with engine running?

Posted: Sun Jan 16, 2011 11:43 am
by GrahamB
Hello,
Just a naive question as I try to understand how the microsquirt/MSII code (2.891) works.
I get the basic idea that there are two copies of the structs, one each in flash and ram
(haven't quite figured out how they are placed appropriately, but maybe when I eventually understand memory paging...
:RTFM: :? :RTFM: ... do :RTFM: until(0); )

... but, if the AMC can burn the fuel tables live, why are all there all those large red-print bits in the Megatune manual saying
I must not burn tables with the engine running?

Re: How does AMC burn flash with engine running?

Posted: Sun Jan 16, 2011 12:22 pm
by grippo
When a flash sector is burned, there is no access to flash (where code is). Unfortunately it takes time to erase a flash sector (a few ms as I recall) because it must be done all at once, so nothing can go on and you might experience a miss, less likely if you are at low rpm. Then repogramming back the flash is not a problem. It can be done word by word without stopping the program for any significant period.

Re: How does AMC burn flash with engine running?

Posted: Sun Jan 16, 2011 12:59 pm
by GrahamB
Ah! So to be clear, if I'm erasing one sector, I can't read any sector... and this is why the assembler jump to the burn program in ram is necessary?

So typically, a 20ms glitch would be enough to lose synch to a toothed wheel, and an ign_reset will be needed before things can get back to normal,
and hence the outpc.rpm <= 1200 condition on burning.
Ok, thanks. A few more lights have come on :)