Pages: [1] 2   Go Down
Author Topic: Is there any way to speed up the ISP programming process?  (Read 1463 times)
0 Members and 1 Guest are viewing this topic.
Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a 1284P in my project and my uploads seem to be going really slow and I believe it is because the IDE is erasing all the flash on board each time it uploads.  Is it possible to avoid doing that and just leave any garbage data after the program?  I would assume it would not interfere with the program for it to be there and since my programs right now are small it should greatly speed up my testing process.
Logged

USA
Offline Offline
Full Member
***
Karma: 0
Posts: 238
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How slow is slow?  FLASH memory must be erased before it can be programmed.
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Eh, feels like it's taking maybe 20 seconds?  Haven't timed it.  Just seems slow. 

Also, I have an old laptop I used to program some other chips and with the same programmer it is way faster than my Macbook.  Any idea what might cause that? 
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In short - YES, write smaller programs...
Logged

USA
Offline Offline
Full Member
***
Karma: 0
Posts: 238
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is your process in programming the chip?
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I set the fuses like so the first time because I was having trouble getting it to program (the IDE hides the option to upload with a programmer so even though I had a programmer selected I was getting com port errors and didn't know why until I figured out the right upload option was on the fil emenu):
http://www.frank-zhao.com/fusecalc/fusecalc.php?chip=atmega1284p&LOW=CE&HIGH=F9&EXTENDED=FF&LOCKBIT=FF

But the boards.txt file has the following fuses:
http://www.frank-zhao.com/fusecalc/fusecalc.php?chip=atmega1284p&LOW=FF&HIGH=DE&EXTENDED=FD&LOCKBIT=FF

I'm not sure if they get programmed though because a couple weeks ago I had a chip on a breadboard that was running slow and I was using the same boards.txt and the right chip selected on the menu.  So I don't think it was being programmed to use my external oscillator.  But the current chip is running at the right speed, going by the fact that my led now blinks once a second like it's supposed to.

Other than that, I just select upload via programmer from the file menu, and I have usbtiny seleced for programmer and avr-developers.com selected as the board for my 1284p.

The thing about one computer programming faster than the other was with 328P's.  I haven't tried it with this chip; I don't have time to mess around with that right now I gotta get this board working pronto and the slow programming is only a minor inconvenience.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use an Atmel AVR ISP MKii within AVR Studio- really fast, once you get past the reeeeeally slow opening screen - it takes so long, I use File :Upload Using Programmer within the IDE instead.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


What size image are you uploading?  (What size is the dot-hex file?)
Logged

Global Moderator
Melbourne, Australia
Online Online
Brattain Member
*****
Karma: 511
Posts: 19356
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a 1284P in my project and my uploads seem to be going really slow and I believe it is because the IDE is erasing all the flash on board each time it uploads.  Is it possible to avoid doing that and just leave any garbage data after the program? 

According to the datasheet for the Atmega2560 a chip erase takes a maximum of 9 mS, so I don't think that is the big bottleneck (I can't find the figure for the 1284P but I presume it is similar).
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The hex size varies but one was up to 44K.
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've also been getting avrdude verificatons errors, though the slowness has occurred before this and with multiple chips.  I then found the verbose option and turned that on.  It takes 24 seconds to write 8400 bytes.  Then it takes 14 seconds to verify it, then I get an error about a byte missmatch, but my program still seems to do what it's supposed to. 
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've unchecked the preference to verify code after upload, but it still seems to be doing it and I've restarted the IDE to be sure.  Is there no way to stop it from spending 14 seconds verifying code when it is going to error anyway?
Logged

USA
Offline Offline
Full Member
***
Karma: 0
Posts: 238
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

According to one of ladyada's webpages, the usbtinyisp takes a second to program a kilobyte.  Maybe you need a faster programmer.  The AVRISP mkII sells for $35 and it is supported by Atmel.

http://www.ladyada.net/make/usbtinyisp/
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1368
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm actually using this:
https://www.sparkfun.com/products/9825

But I don't know if it's any faster or not.  Since it's using the usbtiny drivers perhaps not.
Logged

Idaho, US
Offline Offline
Edison Member
*
Karma: 21
Posts: 1074
Special User
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
According to one of ladyada's webpages, the usbtinyisp takes a second to program a kilobyte
Hm, that's only 8kbps. Is the bottleneck is in the programmer-programee interface? Or is the bottleneck in the PC-usbtinyisp interface (which appears to be bit-banged without the benefit of a FTDI or Max USB-serial IC)?
Logged

Pages: [1] 2   Go Up
Jump to: