PDA

View Full Version : USBASP is too slow , is it just me ? Programmer proposal



vikas
09-27-2010, 11:46 AM
Hi all

I made a USBASP and am using avinash's s/w to program my chips ( Mega8 ). I noticed it takes ages to program.

I do not have exact stats but programming and verification takes over a minute .

While a bigger program on pickit 2 takes like 5 seconds.

Is it due to the emulated USB ? should someone not come out with the proper USB programmer for AVR which is cheap like USBASP ?

Maybe we should build a AVR+8051+PIC programmer on PIC18f2550 ? what do you guys think ?

asimov_18
09-27-2010, 01:09 PM
Well,
Yes the USBASP is slow becuase it is programmed to be so.....the ISP protocol in the code has two options
a) Slow speed for default 1MHz clock on chip resonator
b) Faster speed for 8MHz external clock but for that the fuse need to be programmed first

Also USBasp can program at89sXX chips easily thru slight modification of code...........I will mail you the code for this...


Asimov

pratheek
09-27-2010, 06:58 PM
USBasp is slow, but its the price payed for using a chip that is not meant to handle USB communication.

AVR+8051+PIC programmer on PIC18f2550 - I'm in for it.

avinash_g
09-27-2010, 08:53 PM
Did you short JP3 ? Its for slow SCK for MCUs running below 1.5MHz, like a fresh one bought from Market. After that it can be removed (JP3).

One thing is that AVRISP uses the clock (as set by Fuse bits) during programming also. That is if external crystal is NOT enabled it is running on internal osc, even during programming.

While PIC ICSP clocks the CPU from the clock line of the ICSP during programming.

Also My Software verifies the entire flash during verification. In next version I will change it to verify only the written area. I did so because during programming it skips the memory cells which are all empty (i.e 0xFFFF).

Also I am working to make a AVR Programmer using PIC18F2550 with Full Speed USB (12Mbps) that will be API compatible with USBasp but much more faster(but limited by the WRITE Speed of AVR Flash).

Also the software can be made fast by Transporting larger Block of DATA in one call, but that would make it bit unresponsive(I like to Avoid multithreaded programming).

If you need faster programming you can click Abort during verification.

I have some new features implemented but NOT yet public. If you need I can give you.
*Verifies only the written part of flash (can be changed to full from option).
*SKIP option during verification.
*ASCII View of Flash and EEPROM.

asimov_18
09-28-2010, 12:18 AM
Hi All,
I had posted this before. Why don't you learned souls synergize that would make a formidable team on RI and RI needs a strong team!!!! All gr8 projects have been done in a team and return for such team effort is simply gr8!!!!!

Asimov

Ulhas
09-28-2010, 08:06 AM
Did you short JP3 ? Its for slow SCK for MCUs running below 1.5MHz, like a fresh one bought from Market. After that it can be removed (JP3).

One thing is that AVRISP uses the clock (as set by Fuse bits) during programming also. That is if external crystal is NOT enabled it is running on internal osc, even during programming.

While PIC ICSP clocks the CPU from the clock line of the ICSP during programming.

Also My Software verifies the entire flash during verification. In next version I will change it to verify only the written area. I did so because during programming it skips the memory cells which are all empty (i.e 0xFFFF).

Also I am working to make a AVR Programmer using PIC18F2550 with Full Speed USB (12Mbps) that will be API compatible with USBasp but much more faster(but limited by the WRITE Speed of AVR Flash).

Also the software can be made fast by Transporting larger Block of DATA in one call, but that would make it bit unresponsive(I like to Avoid multithreaded programming).

If you need faster programming you can click Abort during verification.

I have some new features implemented but NOT yet public. If you need I can give you.
*Verifies only the written part of flash (can be changed to full from option).
*SKIP option during verification.
*ASCII View of Flash and EEPROM.

Hi Avinash

I am also very much interested in using PIC18F2550/4550 with Full Speed USB (12Mbps). I don't know how to implement / use the stack.
If you highlight someting on it like compiler,usb routines then i will be in position to share the demo code for Full Speed USB. However i managed to communicate through USB HID with PIC

In fact i also tried in between to make USB based universal programmer for hobbiest

avinash_g
09-28-2010, 08:10 AM
Microchip has a very good and documented USB Stack. Download it!

But you need to have good grip on USB. I would recommend reading the "USB in A Nutshell" by Beyond Logic. Read it over and Over to get the funda. Then you can consult books such as "USB Complete by Jane Alexson"

vikas
09-28-2010, 06:47 PM
like said above microchip has some really good free libraries .

Also another important thing is that microchip gives digitally signed generic drivers for custom use , so you will not face problems with 64 bit machines.

Ulhas
09-29-2010, 08:24 AM
Microchip has a very good and documented USB Stack. Download it!

But you need to have good grip on USB. I would recommend reading the "USB in A Nutshell" by Beyond Logic. Read it over and Over to get the funda. Then you can consult books such as "USB Complete by Jane Alexson"

Thnks

But as i said already i don't know what stack means and how to use it.
I still remember that someone has already gave me suggestion as what you said. I have library with me.
But it is bit confusing for me (means only to me, may be different for others). hence i left it in between.

As long as books are concern i already gone thru these books

avinash_g
09-29-2010, 08:38 AM
If you have already gone through the book then whats the problem? Microchip's stack is easiest to use! The problem with you is that you don't have experience of dealing with a real software project. May be you know the C language theory but you haven't completed any real project.

The "USB in a Nutshell" is the greatest kickstart guide for USB its even better than a Real Commercial Book "USB Complete".

Microchip Stack are the example of Professionally written code. The soure code is completely customizable and portable across its 8,16 and 32bit MCUs. Implementation of these two feature make heavy use of C's Preprocessor Magic and Conditional Compilation. These things makes the code more scary to a non pro.

Now to make you more uncomfortable we have USB 3.0 specification waiting on the door!

The world move really fast>>>>>>>>>>>
http://www.everythingusb.com/superspeed-usb.html

Ulhas
09-29-2010, 04:44 PM
If you have already gone through the book then whats the problem? Microchip's stack is easiest to use! The problem with you is that you don't have experience of dealing with a real software project. May be you know the C language theory but you haven't completed any real project.

The "USB in a Nutshell" is the greatest kickstart guide for USB its even better than a Real Commercial Book "USB Complete".

Microchip Stack are the example of Professionally written code. The soure code is completely customizable and portable across its 8,16 and 32bit MCUs. Implementation of these two feature make heavy use of C's Preprocessor Magic and Conditional Compilation. These things makes the code more scary to a non pro.

Now to make you more uncomfortable we have USB 3.0 specification waiting on the door!

The world move really fast>>>>>>>>>>>
http://www.everythingusb.com/superspeed-usb.html

The only important sentence from your reply for me is "Microchip Stack are the example of Professionally written code"
rest of information i never asked for

avinash_g
09-30-2010, 05:49 PM
USBasp + eXtreme Burner - AVR

Programming ATmega8 (Int 1Mhz Crystal)

Full 8KB Flash Write + Verify = 12 Sec
Full 8KB Flash + Full EEPROM + FUSE Byte (Low + High + Lock) =17 Sec

(With Modified Firmware)
Download here
http://www.extremeelectronics.co.in/downloads/usbasp-atmega8-12Mhz-MYSPEEDY-ver1.1.hex

elecrom
03-01-2011, 10:54 PM
- USBasp is quiet fast. Full flash programming + verification in 5 seconds for ATmega16 running on external crystal. (> 4MHz)
- It depends on the crystal speed how fast you can program. You can controll the programming speed by passing "-B <delay in us>" option on DOS command line.
e.g. To program AVR at 100KHz clock, use switch "-B 10"
- AVR running on internal 1MHz oscillator can be programmed upto 150Khz clock. (Theoretically upto 250KHz but that doesn't work always since internal oscillator have its own error).
- For AVRs running on clock speed beyond 4MHz, you can safely go upto 1MHz clock speed ("-B 1")
- USBasp can be best used on command line.

I have wrote one tutorial and provides some ready made fuse bit configurations here :


http://elecrom.wordpress.com/2010/04/03/avr-fuse-bits-settings/
(http://elecrom.wordpress.com/2010/04/03/avr-fuse-bits-settings/)
http://elecrom.wordpress.com/2009/04/15/avrdude-tutorial-burning-hex-files-using-usbasp-and-avrdude/

vikas
03-02-2011, 12:47 AM
Ahh the old speed thread :) ... I am sorry to say it is very Slow by my standards dont know the exact technical reason ... but its too damn slow.And it does not work with AVR Studio .

Anyhow i had recently ordered this ...

http://www.pololu.com/catalog/product/1300

It uses a microchip 18f like some of us were planning earlier in the thread. It is FAST , everything is under a second (12 MBps USB maybe). It also gives you a slow Scope and a extra USB to Rs232 as a bonus on it PCB . AVRISP/STK500 compatible means AVRStudio works out of the box. So if anyone is looking for a good cheap programmer buy it from pololu. You will love the speeds.

PS: I am impressed with the quality of Pololu products actually,they provide a few electronics but the kind of software,documentation,libraries and support which comes with their products is simply impressive.Maybe the idea is to do a few things and do it WELL.

Coolpratheesh
03-02-2011, 11:41 AM
Guys i might have a small suggestion to make. I think all this can be done through the FTDI ic thats around 200 bucks.
I would seriously suggest you guys look into that.

vikas
03-02-2011, 02:05 PM
MCP2200 is cheaper ... but a extra microcontroller is required to actually do the programming with these USB to UART. Bitbanging using them is VERY slow.Also max at 115 kbps its still 8 - 10 kB/sec is still slow. Also total costs of FTDI + uC hits atleast Rs 350 just for basic components.

That is why a pic 18f , it is 12 Mbps USB and can do higher transfer rates. The overall cost is half and you can give extra features using this uC like serial uart and logic analyzer etc. The only issue in this case is some one has to work hard to build the firmware :) .

Coolpratheesh
03-02-2011, 09:35 PM
den we all should try ...... im in ...... do tell me .... ill put in wat lil knowledge i have ....

vikas
03-02-2011, 09:53 PM
Now that ive found pololu programmer , i don think time should be spent on this project. They are already providing a Really good programmer at a competetive rate ... Replicating their effort is like reinventing the wheel.