USB-ISP Programmer - Page 1
Forum section: electronics / general

author: dan3460
author_rank: Frequent Contributor
timestamp: December 19, 2016, 12:59:28 pm
content: I have been prototyping with arduino for a couple of years, I'm working on a board where I want to program the atmega328 directly so I can use the portion of the memory used by the boot loader. So I bought a cheap Chinesehttp://www.ebay.com/itm/232157187265?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT, maybe that is the problem already.In any case, after several hours fiddling with this thing, downloaded several drivers that should work, I threw it across the room.Did not know exactly what they meant with thisQuote, but I assumed that it would install automatically.The best I could do, with one of the drivers from the internet was to create a entry on the devices list that shows USBHID, for human interface device, but I couldn't make arvdude to find the port.Is anyone dealt with something like this?

author: stj
author_rank: Super Contributor
timestamp: December 19, 2016, 01:26:05 pm
content: that's a USBasp - IMO the best programmer around.http://www.fischl.de/usbasp/you need 1 - 3 things.1: a LibUSB driver if you use windows.http://zadig.akeo.ie/2: the latest AVRdudehttp://download.savannah.gnu.org/releases/avrdude/3: optional GUI if you dont like the commandlinehttp://blog.zakkemble.co.uk/avrdudess-a-gui-for-avrdude/most importantly, dont let some fool talk you into overwriting the firmware in the programmer.the chinese have newer firmware than is openly available with auto speed negotiation.so if you see errors about "cant set fsck" or something like that - ignore it.

author: sleemanj
author_rank: Super Contributor
timestamp: December 19, 2016, 02:01:49 pm
content: As stj says, on Windows you need libusb installed, seehttp://www.fischl.de/usbasp/http://rayshobby.net/dead-simple-driver-installation-for-usbasp-and-usbtiny-on-windows/One of my clients who was having trouble with Windows 7 indicated sometime after he got it working that he "think it was the 23371 USBASP Driver which ended up working on windows 7" and by that I think he must have meanthttp://www.winddeal.net/image/tools/23371%20USBASP%20Driver.zipAs stj also says, the chinese USBAsp devices have auto-speed firmware, which will produce the warning about not being able to set SCK. Unless you need to program a really slow clocking AVR (less than 1 Mhz from memory) ignore the error, autospeed is better especially if using the Arduino IDE because it has no way to set the speed itself.If you do need to set the speed (manually using avrdude), either the original fischl firmware can be used (sacrificing auto speed), or there is a newer firmware fork which supports setting SCKandcan still do auto speed, I've not tried it myself thoughhttps://github.com/bperrybap/usbasp/tree/1.06-alpha/bin(note 1.06-alpha branch!)

author: dan3460
author_rank: Frequent Contributor
timestamp: December 19, 2016, 02:43:41 pm
content: Quote from: sleemanj on December 19, 2016, 02:01:49 pmThanks, I yesterday I used ALL the what you pointed at.Zadig - Once run, it had a empty list of hardware, so I click options, list devices, then by plugging and unplugging the dongle discovered that the new device was called USDHID, I installed the driver 4 times using the 4 options shown by Zadig.I do have the last version of avrdude and also used the arvdudess.avrdude would not find the port.

author: TimCambridge
author_rank: Regular Contributor
timestamp: December 19, 2016, 04:01:30 pm
content: What do you see with the Microsoft USBView utility? It's on the FTDI site:http://www.ftdichip.com/Support/Utilities/usbview.zip

author: dan3460
author_rank: Frequent Contributor
timestamp: December 19, 2016, 05:10:25 pm
content: will look when i'm back home. thanks

author: dan3460
author_rank: Frequent Contributor
timestamp: December 19, 2016, 09:54:26 pm
content: This is what it shows, device loc17 the one I highlighted is the one that shows up when I plug the dongle in. Is that address 0x03 the one that I have to use? if so how do I give that to avrdude?

author: sleemanj
author_rank: Super Contributor
timestamp: December 19, 2016, 10:33:19 pm
content: What version of Windows are you using?

author: dan3460
author_rank: Frequent Contributor
timestamp: December 19, 2016, 11:15:36 pm
content: Windows 10

author: imidis
author_rank: Frequent Contributor
timestamp: December 19, 2016, 11:25:26 pm
content: I had a bit of trouble getting mine going, ended up using the libusbk driver. Had to fidget with it a bit though.

author: sleemanj
author_rank: Super Contributor
timestamp: December 19, 2016, 11:47:52 pm
content: Unfortunatly I don't have Windows 10 available to try myself.A bit of googling indicated that most people could use the zadig stuff. Note that it's 64bit only I think, I can't imagine you'd be using 32bit though anyway.A bit more googling found this maybe:https://www.protostack.com/blog/2015/01/usbasp-windows-driver-version-3-0-7/The github link I posted earlier has this:https://github.com/bperrybap/usbasp/tree/1.06-alpha/bin/win-driver/libusb_1.2.4.0

author: imidis
author_rank: Frequent Contributor
timestamp: December 19, 2016, 11:57:02 pm
content: Dunno if this will help, but it's my windows 10 using usbasp

author: dan3460
author_rank: Frequent Contributor
timestamp: December 20, 2016, 12:38:04 am
content: Imidis, what command you use in avrdude?

author: imidis
author_rank: Frequent Contributor
timestamp: December 20, 2016, 12:45:34 am
content: I use avrdudess GUI selecting usbasp atmega328pto flash?-c usbasp -p m328p -B 0.5 -U flash:w:"C:\Users\TTE\Desktop\file.hex":aThis is how I hook it up on the breadboard with the USBAsp output cable. Of course oscillator config varies.

author: dan3460
author_rank: Frequent Contributor
timestamp: December 20, 2016, 01:45:34 am
content: yep, no luck.avrdude cannot see the device on the usb port. I pull an old nano from a project that I have, loaded the Arduino isp schetch and I was able to talk to it on arvdudess, but the nano creates a com port for the communication.I have to return the nano back to the project, but maybe the solution is to buy another nano. completely frustrated.

author: sleemanj
author_rank: Super Contributor
timestamp: December 20, 2016, 03:39:35 am
content: Quote from: dan3460 on December 20, 2016, 01:45:34 amIt's possible that your USBasp (I've never used the ones with an enclosure) has some different firmware on it.You could use the Nano to flash new firmware on the USBasp.One assumes that you did ask the seller about Windows 10 problems, and that they didn't know jack as is to be expected (but very rarely you might get one who does know what they are selling).

author: stj
author_rank: Super Contributor
timestamp: December 20, 2016, 06:50:18 am
content: try a Linux live disk or a Linux box - it should auto-detect it as USBasp99% it's your shit o.s. causing the problems.upgrade to 7 or Linux.

author: dan3460
author_rank: Frequent Contributor
timestamp: December 20, 2016, 01:00:24 pm
content: Quote from: sleemanj on December 20, 2016, 03:39:35 amYes I did asked the seller by I have gotten no answers and I probably don't expect any, I only pay $4 including freight so I don't think they have a "technical" department.

author: dan3460
author_rank: Frequent Contributor
timestamp: December 20, 2016, 01:02:36 pm
content: Quote from: stj on December 20, 2016, 06:50:18 amYou are probably right but I do not have another box to setup Linux.

author: TimCambridge
author_rank: Regular Contributor
timestamp: December 20, 2016, 03:32:52 pm
content: From USBview it seems that the VID/PID are 03EB/C8B4. If possible you should check that these are the values you expect.Next I would unplug the programmer and run FTDI's CDM Uninstaller (http://www.ftdichip.com/Support/Utilities.htm#CDMUninstaller) That will remove any old drivers lurking in unexpected corners of your system.Then you are ready for a clean install, however that is recommended in the "documentation."--Tim

author: dan3460
author_rank: Frequent Contributor
timestamp: December 20, 2016, 04:22:41 pm
content: Got some sort of communication from the vendor, it seems to have been translated using Google translate, doesn't make too much sense. For what I can understand they are sending me to a website to download the driver but the whole thing is in Chinese.Sorry I'm an old fart that has recently gotten into microcontrollers and some times my brain does not work in the way that is used to do.Tim, what do you mean with "the values that I expect"? How do I check those value?I will try to do an uninstall and pay extra attention on the install process, the vendor says that you do not need drivers, it should install by itself.

author: imidis
author_rank: Frequent Contributor
timestamp: December 20, 2016, 07:31:32 pm
content: I found this on the ebay listingQuoteSo it looks like they messed with the original usbasp and it doesn't work with avrdude.You have a link to the site? I can see if I can find a download. Would have been nice if they made it as a normal usbasp.

author: Heszu
author_rank: Contributor
timestamp: December 20, 2016, 07:33:38 pm
content: Quote from: dan3460 on December 20, 2016, 04:22:41 pmHi there.Yes vendor say,s that one doesn't need driver, system recognize UsbAsp.. Well,Yes, it does recognize as usbasp, BUT cannot find driver!I just tested, I have an open version usbasp and have installed win10 on one laptop just for testing...I took about 10 min all to get usbasp up'nd'running. (on an absolutely clean win10)(So do as earlier in the thread is mentioned, remove all old things)Start here:https://netmaxtech.com/how-to-make/install-usbasp-driver-windows-8-and-windowsFollow exactly.. and install driver ,as described.Next:Then I downloaded :https://sourceforge.net/projects/avrdudegui/Fired up the GUI, selected programmer usbasp, inserted an old atmega chip clicked Read Flash,,with a smile on my face, it worked just great !!Cheers !AAh,, You have found a solution, whilst I was typing...

author: bingo600
author_rank: Super Contributor
timestamp: December 20, 2016, 08:10:41 pm
content: Could it bea "real" usbisp ?Last posthttp://electronics.stackexchange.com/questions/186870/cannot-connect-avr-usb-isp-2-0/Bingo

author: TimCambridge
author_rank: Regular Contributor
timestamp: December 20, 2016, 09:09:23 pm
content: Ah. Reading up the thread a little more, those who know point out that the drivers that you need are the libusb ones, not the FTDI drivers. It can't hurt to remove any lurking FTDI drivers and I would do that if you have the CDM Uninstaller tool. Remove FTDI drivers for your VID/PID: 03EB/C8B4Then you need the Zadig installer which will put the libusb drivers onto your system. You can run Zadig with your programmer plugged in. Make sure the "USB ID" is 03EB/C8B4. Zadig offers several implementations of libusb (click the list to the right of the green arrow), the experts seem to recommend the libusb-win32 version. Then you should be good to go.--Tim

author: TimCambridge
author_rank: Regular Contributor
timestamp: December 20, 2016, 09:26:22 pm
content: This may help:https://learn.sparkfun.com/tutorials/pocket-avr-programmer-hookup-guide/installing-drivers--Tim

author: dan3460
author_rank: Frequent Contributor
timestamp: December 21, 2016, 03:32:36 am
content: Well, I tried all the suggestions, which are kindly appreciated, but the results were the same. I clean up all previous installations, I used the CMDuninstaller program to make sure. I turned off the signature feature on the computer. I downloaded the latest usbasp software and plugged the dongle again, it installed itself as a USBHID with the USBID 03EB/C8B4. Then I force the driver indicated by Heszu, gave me the "driver not signed warning", once finished I can see USBasp on the device manager but when I run arvdude or arvdudegui gives me the same error : could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc.Tired now, spend several hours on this and did not move forward. The last thing i'm doing tonight is to power off the computer to make sure that everything is out and see after coming back if I have communication, maybe this dongle is damaged.As i'm programing using Atmel Studio, maybe I buy one of the devices that work directly with it, maybe.Thanks everyone for all your help, it is greatly appreciated.

author: sleemanj
author_rank: Super Contributor
timestamp: December 21, 2016, 04:03:48 am
content: Quote from: dan3460 on December 21, 2016, 03:32:36 amhttps://www.sciencetronics.com/greenphotons/?p=938First result from googling usb pid C8B4, appears to be exactly about the problem you are facing.

author: dan3460
author_rank: Frequent Contributor
timestamp: December 21, 2016, 12:07:53 pm
content: Interesting, the only problem is that I do not have other programmer. Yesterday, before I started playing back with this dongle, I try to setup a arduino nano as a programmer. I flashed the isp code using the arduino environment, rigged up the wires from the nano to a atmega328P and I used ardudess to read the chip. At first I thought that is was working, it responded to the read and detect commands, after thinking a while, I disconnected the wires to the subject chip and got the same response, so I guessing ardudess is reporting contact with the onboard 328 from the nano. I have not read the ISP sketch, but i'm guessing is meant to work with the arduino environment and not arvdude. At least I'm dong something wrong which will not be unusual.If someone has an idea how to flash the program into the dongle please let me know, thanks.

author: sleemanj
author_rank: Super Contributor
timestamp: December 21, 2016, 01:44:42 pm
content: Setup nano as isp, ensurimg wiring is suitableTurn on verbose output in arduino ide prefsUpload (anything) using the nano as ispObserve the avrdude command line which gets executed to upload via nano as ispUse similar command execution to flash appropriate firmware (see previous links)

author: stj
author_rank: Super Contributor
timestamp: December 21, 2016, 02:45:45 pm
content: to flash a usbasp from another programmer, you have to set a link/jumper on the asp pcb.your asp is probably this design.

author: Rick Law
author_rank: Super Contributor
timestamp: December 24, 2016, 12:31:20 am
content: Quote from: dan3460 on December 20, 2016, 01:45:34 am(bold added to your text)I too have the NANO solution. I found it easiest - since I use the Arduino tool set, I don't have the trouble of making something else work.Since I use it a lot, I have my NANO sitting on a proto-board with headers for ISP programming - 8-pin header for the SOIC clip and a 6 pin ISP Header, plus some dip switches so I can connect/disconnect any ISP lines without having to remove the SOIC clip or 6-pin ISP cable.When I burn a regular ATMEGA328, I can use an Arduino UNO as the carrier for the 328 and use the 6-pin ISP header to connect my proto board to the UNO. Alternatively, I can also use a breadboard to host the 328.When I burn the ATTINY85 or 13, I can use the SOIC clip. My proto-board also has an additional 8pin header breaking out the target MCU's 8 pin. I can put an LED or whatever right on the 8-pin breakout and that will connect to the target AtTiny's 8 pins for a quick test.The great part about using the NANO, I have a dip switch on the proto-board as boot-select. The NANO uses a modified version of the ISP program on the Arduino IDE - basically the Arduino's ISP program with something extra. Depending on the boot-select DIP switch setting, it will either run the ISP portion of the code, or run an RS232 bridge that connects NANO's soft-serial to the NANO's USB serial bi-directionally. The target MCU can read or write to it's RS232 which connects to the NANO's soft-serial. The NANO in turn passes the soft serial to/from the NANO's own hard serial (USB) which connects to the PC. Using the RS232 bridge, I can have my AtTiny85 serial.write or serial.read to/from the PC via the NANO.

author: dan3460
author_rank: Frequent Contributor
timestamp: December 25, 2016, 01:29:44 am
content: Thanks guys for all the help. The other day I ordered a USBASP, with express shipment cost me only $4. I put his on the computer and installed immediately as USBasp, fire up avrdudess connected the leads to a 328p and.....some success. I did not get cannot find device, but I gotQuotesome posts on the internet claimed that this can be ignored, which I did. I clicked the button "Detect", gave two more errors:QuoteSo I added the -F flag and it gives me:QuoteThen I fire up my scope to see what was happening, at least I'm getting signals out of the programmer. I have attached two shots from the scope. First picture, the red trace shows SCL at 184kHz, the yellow trace is MOSI and it looks that the programmer is trying to talk to the 328. The second shot, I move the red trace to MISO keeping MOSI yellow. The response from the chip is tiny, I don't think the programmer can read that.I'm looking for the board where I pulled this 328 to see if it damaged, is there other thing that I should be looking for?

author: dan3460
author_rank: Frequent Contributor
timestamp: December 25, 2016, 01:48:44 am
content: Found the board and the 328 is working perfectly.Ok I think I know what the problem is. This 328p came on a cheap ESR tester that I bought for a few dollars. I think it has been programed not to be reprogramed or read. I remember that I have a bunch of atmegaNanos, wire the USBasp and I can read the nano, which uses the same 328p chip. Is there a way to unlock the chip and in the same question how can you lock the chip once it has been programed?Thanks guys and sorry to bother with such newbie questions.

author: imidis
author_rank: Frequent Contributor
timestamp: December 25, 2016, 03:35:15 am
content: A full chip erase may do it.oh and the sck error I is normall IIRC with that firmware and can just be ignored for real.

author: sleemanj
author_rank: Super Contributor
timestamp: December 25, 2016, 03:36:03 am
content: If a chip has been locked, the only way to unlock it is to erase it, avrdude -e option.However since you are not able to read the signature, and you are sure you have it connected properly then you probably have a fuse issue, either1. the chip has reset or spi programming disabled2. the chip is expecting a clock or crystal to be connected3. the chip is set to clock very slowly, too slow for the USBAsp auto clockingIn situation 1, you need a high voltage parallel programmer in order to reprogram the fuses.In situation 2, you can connect a crystal or inject a square wave into XTAL1In situation 3, either you need an HVPP same as for 1, or reflash the USBasp to use the old non-auto clocking firmware and manually set the bitrate (-B option of avrdude) slowly enough that you can reprogram the fuses appropriately.

author: imidis
author_rank: Frequent Contributor
timestamp: December 25, 2016, 04:46:23 am
content: Hopefully it is number 2.Sorry locking you set the lock bits, but be very careful with it. If it were me, I would lock it from reading, not programming.I look em up viahttp://www.engbedded.com/fusecalc/you cen play with the fuse bits safely, just be sure when you do lock bits on what you are doing.

author: Rick Law
author_rank: Super Contributor
timestamp: December 25, 2016, 07:08:27 am
content: There is also another fuse bit that turns off SPI for the 328. I am not sure how the respond would look like on the scope.Once off, you can't do anything with the chip using SPI at all. However, it is recoverable using a something (I forgot the name - I think it is high voltage programming) that basically uses a higher voltage to reprogram the fuse bits.This high-voltage thing may be another thing to look at.

author: stj
author_rank: Super Contributor
timestamp: December 25, 2016, 11:56:04 am
content: the USBasp is an in-circuit programmer,the avr must have all it's relevent power pins connected and have a clock.

author: Heszu
author_rank: Contributor
timestamp: December 25, 2016, 12:14:45 pm
content: Quote from: dan3460 on December 21, 2016, 03:32:36 amDid You follow exactly the "How To" install unsigned driver to win10Did You choose "Install anyway" when greeted with the "driver not signed warning",, This is crucial , its a must!!Those steps must be followed.. when they succeed, You will smile when firing up avrdude....WBRHz