How does AMC burn flash with engine running?

A forum for discussing the creation, modification, and loading of embedded code for B&G MS-I/MS-II.
Forum rules
Read the manual to see if your question is answered there before posting. Many users will not reply if the answer is already available in the manual.

If your question is about troubleshooting, configuration, or tuning, you MUST include your processor type (MS-I or MS-II) and code version in your post. If your question is about PCB assembly or modifications, you must also include the main board version number (1.01, 2.2 or 3.0).

If you have questions about MS1/Extra or MS2/Extra code configuration or tuning, please post them at www.msextra.com Such questions posted here will be moved to: a temporary MSextra sub-forum, where they will be removed after 7 days

The full forum rules are here: Forum Rules, be sure to read them all regularly.
Post Reply
GrahamB
MegaSquirt Newbie
Posts: 6
Joined: Wed Oct 20, 2010 12:25 pm

How does AMC burn flash with engine running?

Post 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?
grippo
Site Admin
Posts: 286
Joined: Mon Feb 16, 2004 6:55 pm

Re: How does AMC burn flash with engine running?

Post 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.
GrahamB
MegaSquirt Newbie
Posts: 6
Joined: Wed Oct 20, 2010 12:25 pm

Re: How does AMC burn flash with engine running?

Post 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 :)
Post Reply