View previous topic :: View next topic |
Author |
Message |
njepsen
Joined: 13 Aug 2007 Posts: 469
|
Posted: Fri Jan 06, 2012 4:24 am Post subject: Programming Speed |
|
|
I am using an Atmega 1284P and using about 35% of the 128K of program flash. It takes a few seconds to compile, but over 2 minutes to program and verify. ( i need to verify because if not, from time to time there are errors). I'm using the Embud USB-ISP programmer; the PC is a 2010 Toshiba with a SS drive, so there is not much I can do there.. There's got to be a faster way??
I have read
http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=9748&highlight=program+speed _________________ Neil |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 584 Location: Cleveland, OH
|
Posted: Fri Jan 06, 2012 6:19 am Post subject: |
|
|
I'm not familar with your particular programmer, but I'll share a thought or two.
When ISP programming the ISP speed has to be < 1/4 the target micro's clock speed.
Since many of the factory new micros run at 1 MHz, the default ISP programming speed may be set rather low to program these chips.
If you have a 14.x or 20 MHz etc. Crystal on your board, and have changed the fuses to run the micro on the much faster clock, then the ISP speed can be significantly increased.
I usually use an Atmel AVR ISP mkII connected via AVR Studio 4, (AVR Studio 5 is still rather new and not yet error free), and the ISP speed can be selected from the "Main" tab under ISP Mode: Settings Button.
Hope this helps.
JC |
|
Back to top |
|
|
njepsen
Joined: 13 Aug 2007 Posts: 469
|
Posted: Fri Jan 06, 2012 6:52 am Post subject: |
|
|
Hmm, yes I am running an 18.432Mhx Xtal. The programer options tab allows me to set the USB-ISP speed to between 1 - 10, but this seems to not make a blind bit of difference. i've tried them all. I'll have another go, and use a stopwatch to time the download.
Later: Did a stopwatch test. Programmer speed setting makes no difference. _________________ Neil |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Sun Jan 08, 2012 12:20 am Post subject: |
|
|
At the AVR end, programming 40k or so of code should take a few seconds at most. Most programmers use the full speed, apart from the ISP clock setting you already tried.
On a battery driven machine, try setting the speed settings for the main machine as fast as possible. Many laptops revert to slow speeds when running on batteries, just to conserve power. Try plugging in to mains power also.
It is possible the PC is fully loaded up doing something else. Check in the Windows Task Manager what other programs or processes are running, and disable any which you dont need. Look also in the CPU utilisation graph, to see how far the machine is loaded up.
Look in the Control Panel System settings for the USB device, and play with the buffer size settings. Sometimes larger is better, sometimes smaller, it depends how many bytes are transferred in both transmit and receive directions.
Try also a different USB port, or preferably even a different machine, to see if it is just that machine which is slow. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
njepsen
Joined: 13 Aug 2007 Posts: 469
|
Posted: Sun Jan 08, 2012 3:27 am Post subject: |
|
|
Adrien,
Thanks for your detailed reply. I have had a look at the processor workload ( with task mgr) during download and its idling along at about 12% of speed. It is a Toshiba SS harddricve, with a 2.67 GHz Intel processor and has 8.6GB Ram, which I purchased recently to replace an old laptop for specifically for my Bascom work, as the old laptop was struggling. It is running on mains, and I have turned off all the power saving options when on mains.
For comparison, I installed Bascom 2.0.7.3.2 on my desktop machine this morning and ran it with the same Bascom app; it is about twice as fast for the download and verify. Here are the numbers, to process my program which uses 45495 ROM bytes :
LAPTOP:
Processor 2.67 GHz Intel
RAM 8GB
Time for download + verify 75 secs total
Windows 7 ( I hate it)
DESKTOP MACHINE:
Processor 3.3 GHz Intel
RAM 3.5 GB
Time for download + verify 35 secs total
Windows XP
I am unsure where to find the settings for the buffer as you suggested; have looked in control panel and will keep looking. _________________ Neil |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Sun Jan 08, 2012 7:22 am Post subject: |
|
|
Have a new 10 inch laptop here not using bascom on it as its not my machine but the old (about 7 years old) toshiba it is to replace running windows XP is faster (twice as fast!) even thought it has half as much ram smaller hard drive slower but dual core pentium 4 , many more applications running on it. Windows 7 does not impress me either!!
NOTE its half as fast about what your seeing! |
|
Back to top |
|
|
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands
|
Posted: Sun Jan 08, 2012 12:38 pm Post subject: |
|
|
The EMBUD's programmers are not the best in the world, i have two of them but replaced them fot the Atmel AVR ISP mkII because of the programming errors.
I have read in the past that only newer EMBUD's listen to the speedsetting in Bascom, the older one's don't, i have the older ones.
With the mkII i never had any problem, but installing the software is not real easy. |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Sun Jan 08, 2012 11:36 pm Post subject: |
|
|
My main machine is a 1.5 GHz Athlon,
2 Gb memory
Windows XP
I use AVR Studio4, and program with the JTAG MkII interface, it takes about 4 seconds to program up 50 Kb into an AtMega64 via the USB interface. Another 3 seconds to verify. I never found a verify error once the connection is made, so I almost never use it. An AtMega128 should be about the same.
Most of the time is taken transferring data. The actual chip programming is around 5ms per page, so 50,000 bytes / 256 = 170 pages should take less than 1 sec actual chip waiting time.
The few times I used a USB type ISP programmer ( I have a Pololu PGM03A ), I never noticed that its significantly slower than the above.
The USB buffer settings are for devices which use a USB interface, but actually create a virtual serial COM port. You can find the serial port in Control Panel|System|Device Manager|Ports listed by COM number.
Open ( double-click ) the correct COM port number, then go to Port Settings|Advanced and you get a dialog which allows to set the FIFO buffers. Both my receive and transmit buffers are set to HIGH. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
njepsen
Joined: 13 Aug 2007 Posts: 469
|
Posted: Mon Jan 09, 2012 3:28 am Post subject: |
|
|
Thanks Adrien. Well - compared with your programming speeds, I'm crawling. You said Quote: | Open ( double-click ) the correct COM port number | but on both my machines, when I plug in the USB device, it gets listed in the USB devices column ( in device mgr) and there is no serial port associated with it that I can find. There is a com1 in the serial port list, and its buffers are set to high. Setting them low makes no difference to the programming speed. I believe this is my hardware serial port.
Its beginning to look like a short coming with the Ebud USB-ISP programmer, because you also mentioned that you never have any errors; I need to verify because about 10% of the time, I end up with a 'difference at xxxx' and need to do it again, which is trying. I have ordered a new usb-isp programmer from the website, but I'm still keen to find out why this setup is so slow. _________________ Neil |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Mon Jan 09, 2012 7:58 am Post subject: |
|
|
I guess not all USB devices create a serial port. In that case serial buffers and settings etc are not relevant. I can only assume the software in the programmer itself is slowing things down. Since there is a processor in the programmer, to translate from the USB data to the ISP interface the Atmel processor wants, there is plenty of room there for things to be slowed down, or make errors. Personally I would stick with Atmel tools, or at least ones you know work as well as them. Saving a few dollars on a vital tool, and wasting time getting it to work, or putting up with errors and so on, seems like a waste of effort to me. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
njepsen
Joined: 13 Aug 2007 Posts: 469
|
Posted: Tue Jan 10, 2012 3:20 am Post subject: |
|
|
Adrien,
I totally agree; However i think i bought the Embud a few yrs ago from the Bascom website, and at the time it was not cheap; I have prdered the most expensive one of the site, so hopefully it will be better/ faster/more reliable. _________________ Neil |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Wed Jan 11, 2012 3:01 am Post subject: |
|
|
MKII and STK500 run with all ISP clock speed settings on Studio4.
Hubert
edit: W7 and XP |
|
Back to top |
|
|
|