Benchmarking programming time

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I am programming ATMEGA2561 with 250KB code size.
Programming time matters and code updates are frequent.
Therefore I have benchmarked programming times just to discover suprisingly long programming time with JTAGICE MKII in ISP Mode. Here are my results:

11.6s AVRSTUDIO4 AVRISP MKII
16.3s AVRSTUDIO6 AVRISP MKII
18.5s AVRSTUDIO4 JTAGICE MKII JTAG mode
23.5s AVRSTUDIO6 JTAGICE MKII JTAG mode
61.8s AVRSTUDIO4 JTAGICE MKII ISP mode
61.6s AVRSTUDIO6 JTAGICE MKII ISP mode

Measured between clicking 'program' and observing message 'programming OK', using AVRSTUDIO6. Programming FLASH only, preserving eeprom, no verification, erasing entire flash before programming.

I am using external reset option with JTAGICE.
The other connector was disconnected when changing between ISP/JTAG modes.

Because the target is using 14.5MHz oddclock, I have used 2MHz programming frequency in all cases.

1. Is this JTAGICE MKII programming time in ISP mode consistent with you results?

2. Is JTAGICE MKII slower than AVRISP MKII in most cases even in JTAG mode?

3. What is real-life situation with AVRONE?

Last Edited: Mon. Jul 2, 2012 - 09:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Programming time matters

Gee yes, in a typical day you might reprogram the code, what, ten times? You may have wasted 5 minutes of your entire day. Absolutely scandalous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps the JTAGiceMKII has an optimized 'something' inside to make it work fast and efficient with JTAG, but that ISP needs to be bitbanged in an inefficient way.

Not too long ago you would be an extremely happy man if you could refresh the firmware of your gizmo in one minute.

Back then you had to pull multiple EPROMs, UV erase them for 30 minutes, then reprogram them which took 50ms per byte, and then not even counting all the time needed to recompile/relink your code and creating hex files :D

Slightly less longer ago, MCUs came with EPROM; one way to speed up your crash and burn cycle was to have 8 to 10 MCUs which you erased/programmed.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

Programming time matters

Gee yes, in a typical day you might reprogram the code, what, ten times? You may have wasted 5 minutes of your entire day. Absolutely scandalous.

Preparing mass production, genius. Either we do it by hand wasting two days, or do it in bigger house risking code theft or a week of negotiations. Either the person doing it will be well trained and might spot something important in a new batch of hundred products, or get bored and will miss something really critical in related but not immediately visible subject.

Also, as core developer, I deserve the fastest tool for daily use. Therefore I share the benchmark.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:

Back then you had to pull multiple EPROMs, UV erase them for 30 minutes, then reprogram them which took 50ms per byte...

While your data is accurate and would be interesting except that you can find this historical data in wikipedia, as those times ended some 10 years ago. The question is, which programmer allows me to update the code faster than I change my socks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can calculate the minimum time for ISP quite easily. The actual page-programming time is 5ms or so. Most AVRs have less than 256 pages of flash. Hence you are talking about 1.5 seconds to program any AVR.

The bottleneck is down to filling the page buffer via SPI or JTAG. If you are using SPI at 2MHz, this is some 250kB * 4 SPI bytes = 1M * 4us = 4 secs.

So theoretical minimum programming time is about 6 secs, with a similar time to verify.

So I reckon your AVRISP-2 is doing a pretty good job.
Perhaps you could shave off a second or two by storing the flash image in programmer local memory. Dataflash or SDCard will still need read time.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice analysis, David. I was always amazed how much faster {the cheap one!} AVRISP MKII is compared to any other clone, which usually did the job 8 times slower at best.
I am just a little concerned if I didn't overlooked something obvious, that makes JTAGICE so slow. It is also interesting to note that record time has been obtained with AVRSTUDIO4.
As I said we are talking about a batch of 100-300 products so basically I am looking for the correct match of tools and settings rather than deep modification.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I never dreamed of meeting a real core developer. May I have an autograph?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess using a AVRISPmkii with studio 4 is the way to go then. I don't know how much time it actually takes to prepare your widget, e.g. unpacking the PCB, plugging it in on a power supply, attach connector, fiddle with the PC, detach, repack etc.

Do you have a jig so it takes less time? Maybe you could use multiple PCs to speed up things.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kbosak wrote:

I am just a little concerned if I didn't overlooked something obvious, that makes JTAGICE so slow. It is also interesting to note that record time has been obtained with AVRSTUDIO4.

The JTAGICE is designed for debugging. I guess that any IDE is also optimised this way. The overhead of communicating between the debug software and the 'debug agent' is pretty significant.

I suspect that the JTAGICE will do your ISP almost as fast if you configure the software properly. Do you care? After all, the AVRISP-2 will always be faster.

Quote:
As I said we are talking about a batch of 100-300 products so basically I am looking for the correct match of tools and settings rather than deep modification.

Ok. 300 boards at 20 sec / board will take 2 hours. It is worth making a jig if you will be doing many batches.

I can see that the operator will be fed up after her 2 hour ISP stint. Why not buy her / him a nice cup of coffee and a doughnut?

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I can see that the operator will be fed up after her 2 hour ISP stint. Why not buy her / him a nice cup of coffee and a doughnut?

Because I will be doing the first batch in order to 'debug the process and clean the mess', while I am already getting fat and one more coffee per day won't make a difference. This may sound like 20s but this is 20s of interruption when one gets deconcentrated.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Be realistic. It will take longer than 2 hours to make a jig. Any time typing messages on AvrFreaks is going to be time not burning firmware onto AVRs.

You can always celebrate with a cup of herbal tea and a lettuce leaf.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Weren't interns invented for exactly these kinds of jobs?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Geez, why's there so much hostility in this thread? OK so programming time doesn't matter for all of us and we could argue about that all day, but from a purely technical PoV the same physical interface with different tools varies in overall programming time by a factor of 6. Regardless of how big a problem you think this is, it's still a bug IMO.

@kbosak Is this consistent across different PCs? What's the antivirus situation on those machines? I've had to mediate a few fights between Kaspersky and avrdbg.exe, I don't know whether one of these would be bighting you?

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Was I being hostile ?

I thought that I was adding some realism to the subject. i.e. what is the theoretical time, and what is a practical time.

Most importantly, how much employee time and aggravation.

As a separate issue, it may be interesting to see what the best JTAGICE-mkII ISP time may be.
I am sure that people have made 'best time' comparisons before. It seems fairly pointless to time AS4 or AS6 from a production point of view. No one is going to use Studio for 300 chips.

David.

Edit. I tried a JTAGICEmkII with a 16MHz ATmeg128 and a 128k binary file.
AS4: ISP @ 4MHz took 91 secs for program + verify.
AS4: JTAG took 16 secs for program + verify.

avrdude -c jtag2isp took 65 secs for program + verify.
avrdude -c jtag2 took 25 secs for program + verify.

Note that avrdude takes several seconds on its fuse checking. The actual reading or writing is as fast or faster than AS4.

These times are substantially longer than the theoretical times.

I don't possess a AVRISP-2, but I have always understood that it is pretty fast for ISP. If speed is important, you store the image locally and use ISP at maximum speed from a custom programming application.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Was I being hostile ?

I thought that I was adding some realism to the subject. i.e. what is the theoretical time, and what is a practical time.

Most importantly, how much employee time and aggravation.

Sorry mate, not you, I was more referring to eg
Quote:
I never dreamed of meeting a real core developer. May I have an autograph?
and other little snipes :)

Thanks for the solid numbers, interesting stuff

-S.