Pocket AVR Programmer problem

Discussions on the software and hardware for Atmel's STK standard.

Moderator: phalanx

Pocket AVR Programmer problem

Postby artbot345 » Tue Mar 08, 2011 9:54 am

Hi l got my Pocket AVR Programmer yesterday and installed the drivers smoothly by using this commment:
A proper solution for running under Windows 7, including 64 bit, without turning off driver signing.

Download the windows driver from sparkfun, and unzip it somewhere.
Download a recent libusb release from sourceforge: http://sourceforge.net/projects/libusb- ... -releases/ and unzip it somewhere.
Take the libusb0.dll and libusb0.sys files from the sourceforge bin\amd64 directory, rename them to libusb0x64.dll and libusb0x64.sys, and replace those files in the sparkfun driver directory.
Replace the sparkfun libusb0.sys and libusb0.dll with copies from the sourceforge bin\x86 directory (renaming the sourceforge libusb0_x86.dll to libusb0.dll).
Your driver is now ready to go. Windows will complain during the install that the drivers aren't signed, but they actually are. Once installation is done, Windows will happily load the new drivers.

Sparkfun: please update those four files in driver zip file. That will fix it for everyone.
But when I tried to program with it I get the rc=-1 error.
I am running on a Win7x64bit and using AVRDude from WinAVR to download .hex files from BASCOM demo.
artbot345
 
Posts: 1
Joined: Tue Mar 08, 2011 9:42 am

Re: Pocket AVR Programmer problem

Postby platypus » Fri Apr 13, 2012 7:05 pm

I have a brand new Intel based laptop running Win 7.

I tried your suggestions but although the devicemanager said there was a comport, none was listed in Device Manger next to the programmer.

The Arduino IDE saw no serial port.

Consequently the programmer cannot work.

I used the ia64 (intel) drivers of course, not the amd folder.

Win 7 loads the drivers automatically but somehow seems to get it wrong and will not update.

I must have missed something, however it should not be difficult at all.

I see the setup file seems to use the lib0 not the lib0x64 files. So Win7 somehow is loading the wrong files.

i feel the problem is in the setup file itself.

I also have three XP PC's all of which had no such issues installing this driver.
platypus
 
Posts: 7
Joined: Fri Apr 13, 2012 6:51 pm

Re: Pocket AVR Programmer problem

Postby Neuntoter » Sun May 13, 2012 2:02 pm

platypus wrote:I used the ia64 (intel) drivers of course, not the amd folder.


Those are for itanium based 64 bit systems. Which your laptop is not.
Neuntoter
 
Posts: 2
Joined: Tue Jul 19, 2011 11:45 pm

Re: Pocket AVR Programmer problem

Postby platypus » Sun May 13, 2012 8:38 pm

I found the driver to get this working on the Adafruit website - they have a driver with date stamped after Win 7 was released.

The driver loaded without any issue. The programmer works fine now. Also, it burns bootloader without an issue.
platypus
 
Posts: 7
Joined: Fri Apr 13, 2012 6:51 pm

Re: Pocket AVR Programmer problem

Postby mattallen37 » Tue Jun 26, 2012 3:44 pm

@platypus Can you please post a link?
mattallen37
 
Posts: 15
Joined: Thu Mar 01, 2012 9:58 pm

Re: Pocket AVR Programmer problem

Postby platypus » Tue Jun 26, 2012 11:01 pm

Here are a couple of links
Adafruit Usbtinyisp product page https://www.adafruit.com/products/46

The detail page
This is documentation for a simple open-source USB AVR programmer and SPI interface. It is low cost, easy to make, works great with avrdude, is AVRStudio-compatible and tested under Windows, Linux and MacOS X. Perfect for students and beginners, or as a backup programmer.

The project is based off of the USBtiny code & design. The main improvements are: adjusting the code to allow it to act as a SpokePOV interface, adding lowlevel bitbang commands, and addition of a "USB good" LED. Other changes are new VID/PID (to make it official), removing some of the commands, and moving around the pins a bit.

You can build this design using the schematic and firmware, or buy a kit from the Adafruit webshop. Having a full kit available solves the "chicken & egg" problem of purchasing or building a USB programmer that then needs a programmer of some sort to 'kick start'. (See USBasp, AVRdoper, USBprog)

All the firmware code is distributed under the GPL, the hardware design layout files are CC 2.5 Attrib./Share-alike

Comments and suggestions should be posted to the forum

DRIVERS ARE HERE
http://www.ladyada.net/make/usbtinyisp/download.html
Drivers

For windows, we use a modified LibUSB driver. You can download it here:

Windows USBtinyISP driver built with libusb v1.12.

The windows binaries below are built for this driver. If you want to use the latest WinAVR use this!
If you are using 64 bit windows Vista or 7 (or you're just plain having annoying problems with the driver above), try the Windows 7 x64 bit driver. You'll still need to click the button taht says "install anyways" when it complains its not verified.

For historic reasons, we have a:

Windows USBtinyISP driver built with libusb v1.10. Use this for older WinAVR's. Dont use this unless you have to interface with old versions of software that are bound to libusb v1.1

NOTE
The DRIVERS page as above contains first, the 32bit Windows driver and next, the 64bit driver version(use this one for Win7)

Please note that some virus programs like Zonealarm WILL and DO interfere with driver function. As will some other programs which cause memory conflicts.

If you are serious about Arduino programming then I suggest to use a simple PC/laptop configuration WITHOUT virus programs.

Now here is a tip with virus programs, like Zonealarm - you can shutdown the program but part of it will stay resident - Resident Evil!!
It can be shutdown but after you shutdown Zonealarm, you have 5 seconds to delete the annoying exe file which is responsible for the corruption - Zonealarm know about this and are working on a fix!

SUMMARY
In short, use a simply configured PC with XP or Win7. Vista - well don't bother!

USING THE USBTINY

Loading driver------
Clean up a PC or use a new one..(see above)
Connect the Usbtiny

Now,Load the usbtiny driver
...wait for a success message..
When it is ready you will see a blue led lit near JP1 and another blue led at D-, plus a red led lit at Stat1
In program mode more leds are lit, plus the Arduino Pin13 led.
Uploading a program(sketch) takes about a minute on my Win7 laptop (40secs on my XP laptop)
Burning Bootloader takes about 2 minutes on the Win7 machine followed by a Avrdude success message - I prefer to use Shift/Upload as I can see the hex code stream then a Flash Memory Verify followed by Avrdude Done Thankyou! -
Now you know it has worked!!

Arduino Connection- remember the 6pin connector runs across the pcb, NOT toward the closest edge (bad design Arduino!! - only Pin 1 is numbered(trifocals!!))
ICSP Pin config
1,2
3,4
5,6
Run lead <---- from left edge of ICSP pin stack.

I suggest you upload a program then follow by burning bootloader - this tests the functionality of the connection.
Once you burn bootloader, you now have no program, so upload it using either usbtiny or bootloader.

Remember if you are using IDE ver23 or earlier you will need to configure the Preferences.txt file - as - upload using = usbtiny or upload using = bootloader
BUT - make sure the IDE is not running while this is done and file saved else it won't take.
Now open the IDE and off you go.

The advantage of using an external programmer like usbtiny is that you don't need a port for each Arduino chip you want to program - and there are only so many ports.


Good luck!
platypus
 
Posts: 7
Joined: Fri Apr 13, 2012 6:51 pm

Re: Pocket AVR Programmer problem

Postby flogic » Sun Aug 26, 2012 9:19 am

Ok, it took me a little fiddling but I got it to work. The Ada Fruit UsbTiny drivers seem to work. Though there seem to be some catches.

This is the command I got to work.
Code: Select all
avrdude -c usbtiny -pm328p -U  flash:w:blink_1mhz.hex


1. The '-p' option on the product page seems to be wrong mine wanted '-pm328p'.

2. It wouldn't work with the '-B 1' option. Looking at the avrdude docs (http://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions) this really isn't surprising as the base atmega328p runs at 1mhz and the flag requires >= 4mhz.

3. The mfile Makefile needs a bit of work for "make program" to work. The MCU value is used all over the place, so replacing it with my -p values doesn't seem smart. It's probably better to add and AVR_MCU variable and use that instead. Also the avrdude command has '-P' for a port. I don't know if that breaks or does anything with "usbtiny".
flogic
 
Posts: 1
Joined: Sun Aug 26, 2012 8:53 am

Re: Pocket AVR Programmer problem

Postby platypus » Sun Aug 26, 2012 9:38 pm

Perhaps use the IDE and select usbtinyisp from the external programmers list.

If using the Command Line interface you need to know exactly what to do or you will have problems.

Can I also suggest that while working with C++ and/or microcontroller programming that you disable your antivirus program and perhaps any other program that might use some memory as conflicts can occur.

I found that my best experience was with a laptop running XP with service pack 3 BUT NO antivirus at all loaded.
Especially Zonealarm - even if you shut it down there is still part of it that stays memory resident - its an exe file that loads within about 10 seconds of shutting Zonealarm down - so you need to know where this file resides and kill it before it executes - almost impossible - better to remove Zonealarm program completely. Even other antivirus programs may cause conflict.

I believe that using a clean OS is much better than using a PC filled with all types of software that can at any time cause memory and other resource conflicts.

So, much better when doing this work, is to use a system with no frills. That said - I have had no issues with running Microsoft Office programs which can also be helpful during development.

Try using the Arduino IDE or the Wiring IDE ( http://wiring.org.co/download/ ) - instead of the Command Line interface which is low level and can be tricky - you should have no problems.

Another IDE is the Atmel Studio 6 - http://www.atmel.com/products/microcont ... fault.aspx

On this page you can also access all their microcontrollers - 8 & 32 bit AVR's and ARM ucontrollers.

Studio 6 supports all 8,32 bit AVR and ARM ucontrollers. It has a full debug editor just like a good C++ IDE - in fact it's based on Microsoft's Visual C++ - and it's a free download from Atmel. Plus you have much more to play with. Even look at the Atmel development boards
- the Xplained versions http://www.atmel.com/products/microcont ... plain.aspx

You will also see this and other links under "Related items" on page http://www.atmel.com/products/microcont ... fault.aspx

And this site for a reasonable starter tutorial - http://newbiehack.com/MicrocontrollerTutorial.aspx

And from there, it will appear to you that your journey has just begun and should become a lot more interesting than trying to use the somewhat confusing command line code.

See how you go.
platypus
 
Posts: 7
Joined: Fri Apr 13, 2012 6:51 pm

Re: Pocket AVR Programmer problem

Postby farnoise » Sun Nov 11, 2012 5:37 pm

Hello Guys,
I am having trouble with the pocket programmer, when I connect it to the computer it doesn't get picked up by Windows (Popup new device notifier). I have started my own threat my haven't got an answer.
I am using Windows 7 and tried every possible Driver combination that existed on the forum. At the end I only see the Avrdude Error, could not find the usbtiny device.
I also only see 1 LED lit up and both state LEDs are off and NEVER came on
farnoise
 
Posts: 5
Joined: Sun Nov 11, 2012 8:48 am

Re: Pocket AVR Programmer problem

Postby mattallen37 » Sun Nov 11, 2012 10:13 pm

Are you sure you are using a USB data cable, and not just a charge cable?
mattallen37
 
Posts: 15
Joined: Thu Mar 01, 2012 9:58 pm

Re: Pocket AVR Programmer problem

Postby farnoise » Mon Nov 12, 2012 3:01 pm

Yeah, I am using a BlackBerry cable which I use to connect my BB to pc, I have also tried PS3 cable which connects the PS3 the console. I had the same result with both...
Although now you are saying it made me think... Shouldn't the BlackBerry cable work as a data-power cable?
farnoise
 
Posts: 5
Joined: Sun Nov 11, 2012 8:48 am

Re: Pocket AVR Programmer problem

Postby platypus » Wed Nov 14, 2012 7:05 pm

farnoise wrote:Yeah, I am using a BlackBerry cable which I use to connect my BB to pc, I have also tried PS3 cable which connects the PS3 the console. I had the same result with both...
Although now you are saying it made me think... Shouldn't the BlackBerry cable work as a data-power cable?


Yes, the Blackberry is both data and power. It also uses usb-micro to usb-A. Most(perhaps all) phones use a micro-usb.

The usbtiny uses a mini-usb.

Use this driver link - this driver works for Win7 - I had the same issue before loading this driver.
Not sure if Sparkfun have updated their driver yet but their old driver will not work for Win7 - it predates the Win7 release. Suggest you delete this old driver from your system(or confusion might result) and load the correct driver for the usbtiny as in the link below.

http://www.ladyada.net/make/usbtinyisp/download.html

I wrote a substantial post on this problem some time ago, perhaps have a look as there could be some information to help you.
platypus
 
Posts: 7
Joined: Fri Apr 13, 2012 6:51 pm

Re: Pocket AVR Programmer problem

Postby farnoise » Wed Nov 14, 2012 8:16 pm

Thanks a lot for your feed back. I have tried this method and it didn't work, but I'd like to emphesis on the issue that the windows doesn't pick up the new device. You know how you connect a new USB device and it picks it up and starts looking for a driver? It doesn't do it with this, its like nothing is connected and only the power LED comes on!! Did you had this issue too?

I decided to order another device, SP client support didn't respond to my last email (yet).

Thanks,
farnoise
 
Posts: 5
Joined: Sun Nov 11, 2012 8:48 am

Re: Pocket AVR Programmer problem

Postby platypus » Wed Nov 14, 2012 9:06 pm

My usbtiny has three LEDs lit with nothing connected to the output.

These LEDs are - Power, D- and the red Stat1 led.
I don't have any information on the states of the D+, D- or Stat1 and Stat2 LEDs - perhaps Sparkfun IT could reply to everyone. However D+ and D- stand for Data, so if the D- Led is off you have no Data connection.

During programming the blue D+ Led lights to show data is flowing.

It's possible that you have a faulty programmer.

With Win7 I don't get any comments when the usbtiny is attached. But I get the two blue LEDs and the Stat1 red Led.

But if you go to START "Search Program's and Files" and type device manager or part of the string, a window appears with options.

Choose Device Manager, then double click on LibUSB-Win32 Devices.

If your programmer is seen then it will show up on the next line as USBtiny.

If its not there and you only have the Power Led then there is no USB communication.

Try another USB cable - make sure it's a mini plug at the usbtiny input, which you likely already have done.

So perhaps try another cable then contact Sparkfun and get a replacement.

I suggest to buy two - they are cheap enough - in case one fails for any reason.
platypus
 
Posts: 7
Joined: Fri Apr 13, 2012 6:51 pm


Return to AVR Microcontrollers

Who is online

Users browsing this forum: No registered users and 2 guests