Manchester, New Hampshire
Offline
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« on: October 23, 2012, 06:21:25 am » |
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
Full Member
Karma: 0
Posts: 231
|
 |
« Reply #1 on: October 23, 2012, 10:42:49 am » |
How slow is slow? FLASH memory must be erased before it can be programmed.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester, New Hampshire
Offline
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« Reply #2 on: October 23, 2012, 11:16:44 am » |
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
God Member
Karma: 8
Posts: 976
|
 |
« Reply #3 on: October 23, 2012, 11:50:14 am » |
In short - YES, write smaller programs...
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
Full Member
Karma: 0
Posts: 231
|
 |
« Reply #4 on: October 23, 2012, 11:57:44 am » |
What is your process in programming the chip?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester, New Hampshire
Offline
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« Reply #5 on: October 23, 2012, 01:05:30 pm » |
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=FFBut 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=FFI'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
Offline
Brattain Member
Karma: 249
Posts: 16566
Available for Design & Build services
|
 |
« Reply #6 on: October 23, 2012, 01:07:38 pm » |
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
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 120
Posts: 10183
|
 |
« Reply #7 on: October 23, 2012, 10:16:23 pm » |
What size image are you uploading? (What size is the dot-hex file?)
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #8 on: October 24, 2012, 01:06:29 am » |
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
|
|
|
|
|
Manchester, New Hampshire
Offline
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« Reply #9 on: October 24, 2012, 04:12:53 am » |
The hex size varies but one was up to 44K.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester, New Hampshire
Offline
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« Reply #10 on: October 24, 2012, 05:23:49 am » |
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
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« Reply #11 on: October 24, 2012, 05:41:12 am » |
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
Full Member
Karma: 0
Posts: 231
|
 |
« Reply #12 on: October 24, 2012, 08:14:43 am » |
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
Edison Member
Karma: 0
Posts: 1120
Propmaker
|
 |
« Reply #13 on: October 24, 2012, 08:44:04 am » |
I'm actually using this: https://www.sparkfun.com/products/9825But I don't know if it's any faster or not. Since it's using the usbtiny drivers perhaps not.
|
|
|
|
|
Logged
|
|
|
|
|
Idaho, US
Offline
Jr. Member
Karma: 5
Posts: 71
Special User
|
 |
« Reply #14 on: October 24, 2012, 09:34:52 am » |
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
|
|
|
|
|
|