PDA

View Full Version : Atmega88-p chip programmer



Warlock
12-15-2009, 10:16 AM
Does anyone know of a cheap programer for this chip that RPM uses ??
Thanks for the help as I'm left with no choice other then to get one myself and flash my own chip :-(

Entropy
12-15-2009, 10:40 AM
There are lots of AVR programmers.

Cheapest approach is parallel port based, but I would strongly reccommend spending a bit more money for a USB-based programmer since hardware parallel and serial ports are getting rare.

http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=46 is what I use for my AVR programming, it's more expensive than the parallel port option at $22, but IMO worth every penny.

Edit: Note, the above is designed to work if your circuit has a standard AVR ICSP header installed. If your project/circuit doesn't have an ICSP header, you'll need to wire up an adapter, or consider one of the target boards from EMSL. EMSL also stocks the Adafruit USBTinyISP kits, so you can get everything from one source.

http://evilmadscience.com/tinykitlist/74-atmegaxx8
http://evilmadscience.com/tinykitlist/106-usbtiny
http://evilmadscience.com/partsmenu/54-zif20

(The last link, for a ZIF socket, is not necessary if you get the ZIF bundle at the first link, which has a target board, an ATMega168, and a ZIF socket for $14.)

BTW, the ATMega168 is pin and program compatible with the 88 (just has twice the flash memory), so for a total of $36 to get the programmer, adapter board with ZIF socket, and your first AVR chip.

Warlock
12-15-2009, 11:02 AM
It's for RPM's dmx dongle..I need to program the chip myself to get it working.Would that unit work to program the chip ???

Entropy
12-15-2009, 12:08 PM
I just checked RPM's board design and schematics, and his board includes a standard 6-pin AVR ICSP header.

So all you would need is the USBTinyISP, no need for the target board. Note that the USBTinyISP is a kit, you'll need to assemble it, but since you're assembling RPM's board this shouldn't be an issue. :)

Oddly it looks like SOME of the ICSP pins are also wired to the UM245R module, but not all. If they were all wired it may have been possible to bit-bang program the unit without a separate programmer.

Warlock
12-15-2009, 12:13 PM
That was my origional idea can it be programmed without a programer and using the usb um245r to program it ???

So if you can give me the part number to the programmer that will work it would be greatly appreciated and I can get started blinky flashy asap..
Thanks again for all your help
Joe..

Entropy
12-15-2009, 01:12 PM
Based on the schematic, I don't think the onboard UM245R in RPM's DMX dongle will cut it. It has some of the ICSP lines wired to it, but not all. (Notably, RST is not wired along with one of the other lines.)

Since there is an ICSP header on RPM's DMX dongle, all you need is the USBTinyISP kit from either Adafruit or EMSL. Your choice depending on shipping policies and available stock - both are carrying the same item.

It's the only link to Adafruit in my post above, and the second of my three links to EMSL in the same post.

dmcole
12-15-2009, 01:14 PM
Try this:

http://www.adafruit.com/index.php?main_page=product_info&products_id=46

Note that you'll need an A-to-B USB cable ... it has a square box on one end and the flat plug on the other.

HTH.

\dmc

Warlock
12-15-2009, 01:19 PM
Thanks DMcole..I have 20 of those cables...
Joe..

Entropy
12-15-2009, 04:02 PM
That makes two votes for the Adafruit kit. :)

dmcole
12-15-2009, 08:54 PM
That makes two votes for the Adafruit kit. :)

And on a board dominated by Microchip developers, that's a landslide ;) ...

\dmc

Entropy
12-15-2009, 09:48 PM
Hahahah! Yeah, lots of PIC guys here.

I've been slacking on my development for too long, hoping to increase the AVR count and maybe even the Xilinx Spartan count. :) (I haven't done any FPGA development yet, but it's next on my list of TODOs.)

budude
12-16-2009, 01:40 AM
Hey - remember wjohn and RPM are both AVR'ers also!

Matt_Edwards
12-16-2009, 03:57 AM
if it is only one device you want to program AND you have a spare parallel port, then try this (http://www.bsdhome.com/avrdude/)

lot of ppl started out that way. there are some refinements on the web that add driver chips too
Cheers
Matt

n1ist
12-16-2009, 07:15 AM
Add me to the AVR list :-) I'd go with either Limor's kit or a real AVRISP-2. If you just need one programmed, I can do it for you.

/mike

Entropy
12-16-2009, 08:20 AM
It's a real pain to find parallel ports these days, which is why I strongly reccommend the kit from Limor (ladyada).

I can't find any of my old AVR projects... I could swear I backed up my entire Linux home directory when I reformatted, I'm wondering if they were under a different username for some reason. Nothing particularly big lost, although reimplementing my 8-channel software sigma-delta modulator (alternative to PWM) will be a pain.

wjohn
12-17-2009, 10:45 PM
And on a board dominated by Microchip developers, that's a landslide ;) ...

\dmc

I have both (PIC and ATMEL), and just PICked up another ATMEL development board ;-)

mrpackethead
12-18-2009, 11:13 PM
And for what its worth, I picked up Parrallax propeller to add to the list of micros.. Each has a place and its then a case of careful choice of which is best for what.

Entropy
12-20-2009, 01:38 PM
Yeah, at some point I may take up PICs as for a select few projects, PICs are available in price points Atmel isn't at. (Mainly the sub-$1/unit market)

Atmel seems to be a bit ahead in terms of programming their products with C. AVRs are supported by GCC, while PICs only appear to be supported by commercial compilers.

For absolute newbies, both PIC and AVR have options - PIC has the Basic Stamp, AVR has the Arduino. The Arduino gives less of a barrier to "graduating" to straight C in my opinion though, as the Ardunio IDE is really only a set of C macros/libraries that frontend to GCC. Arduino hardware makes for great development boards even for those developing in straight AVR-GCC. (I do almost all of my development on an Adafruit Boarduino, but have a PJRC Teensy++ on my Christmas list for USB work.)

The Propeller looks cool for some applications.

Cypress has some "PSoC" chips which are basically microcontrollers with configurable peripherals, that interested me a lot at first, but they're too expensive for most work. For example, they have one chip that's perfect as a 4-channel constant current LED driver, but it's $12. (Although I forget how much four LM3404s would cost... hmmm...)

At some point (not until I have a better workspace after I buy a house), I want to start working with some Xilinx FPGAs. They've come down a lot in price, some of the midsize Spartans such as the XC3S250E are under $15 now. There's a project going on to create a logic analyzer using one for under $50 total, and the board they have would also make a decent development board - http://dangerousprototypes.com/2009/12/17/open-source-logic-analyzer-update-2/

dmcole
12-20-2009, 02:03 PM
I favor the Atmel products because there's a development chain for Macs -- my Mac-to-PC ratio around here is something like 8:1.

\dmc

DynamoBen
12-20-2009, 08:09 PM
The Propeller looks cool for some applications.


I've been using the Prop for over a year now, not only is it very powerful but its easy to learn. See my Prop Dimmer project thread (here in DMX) for an example of what it can do, also check out the Helix which is also driver by a Prop.

Entropy
12-20-2009, 11:31 PM
I favor the Atmel products because there's a development chain for Macs -- my Mac-to-PC ratio around here is something like 8:1.

\dmc

That all goes back to the fact that Atmel AVR is one of the few microcontroller platforms that is a GCC target.

I'm a heavy Linux user, which is why I like AVR-GCC (even though my initial exposure to AVRs was CodevisionAVR in my undergraduate microcontrollers class), and why I'm planning on eventually doing some Xilinx Spartan FPGA design work - Xilinx is (or at least was as of 2-3 years ago) the only FPGA manufacturer with a free toolchain for Linux.

n1ist
12-21-2009, 10:38 AM
I have used GCC for the AVR as well as the MSP430 and LXP (ARM7) families. I think there's a version for some of the newer PICs too; it's the PIC16 family that is not the best for C coding.

As for FPGAs, Altera has their free Quartus toolset available on Linux.
/mike

Matt_Edwards
12-21-2009, 04:07 PM
Back to OP, did you find a suitable programmer?

Warlock
12-23-2009, 01:19 PM
Ok I got the usbtiny avr programmer and yet still nothing...I can not get this piece of junk to program...The files RPM sent over do not work,nothing has been working.In his instructions it says to go get avrdude which is included in another package that is command based.How does one take files from 1 spot and move them via the command to a directory that doesn't exist ?????When avrdude was installed it was supposed to create this directory where the files were supposed to go..Well said directory was never created not does it even remotly exist.So this programmer which is supposed to be easy to use is so far to me nothing but junk...Any help before this goes against a wall would be greatly appreciated..
Thanks.
Really frustrated
Joe...

DynamoBen
12-23-2009, 02:26 PM
Folks I'm considering moving this thread to development since its so technical in nature and hardly DMX related. Objections?

dmcole
12-23-2009, 02:46 PM
Folks I'm considering moving this thread to development since its so technical in nature and hardly DMX related. Objections?

Ben: You're right. This isn't really DMX related.

Joe Warlock:

Don't worry -- we'll talk you through getting the code loaded.

First, what platform -- Windows (version?), Mac or Linux?

Second, what version of AVRDude do you have (it needs to be v5.5)? Can you give us a screenshot of the AVRDude directories?

Third, when you plug in the USBTiny, does the green LED light?

\dmc

Warlock
12-23-2009, 03:10 PM
Sorry but this is DMX related as it involves programming a DMX dongle..

I'm using windows xp,verson 5.5 of avrdude and yes I get a green light when I plug in the tiny..When I try and open the code RPM sent me is flashes red for a second then nothing...When I plug the dongle in I get no heart beat at all still...Also there are no directories at all other then dll files that have been loaded...
Thanks for the help..
Joe..

P.S. I do appologize for my earlier post but this is really frustrating when you do follow instructions and it still doesn't work as the instructions read it should.So hopefully this will help out more then just myself in the end..
Thanks again.
Joe...

DynamoBen
12-23-2009, 03:57 PM
Moved to Development

Matt_Edwards
12-23-2009, 04:22 PM
Please confirm you are using a ATMega88P and not a standard ATMega88 (no P or PA). there is a difference.

The most critical items to pay attention to are the fuses.

If you go the Studio way I can talk you through programming it with Screen dumps if needed.

Do you only have one ATMega88P?

BTW,
I understand your frustrations, I had a similar issue with the Grinch Dimmer, but I can confirm they are not a piece of junk.;-)
my problem came down to understanding the OSC fuses. the PA version has more options than the standard version as the Oscillator drive has been redesigned.

Cheers
Matt

Warlock
12-23-2009, 10:25 PM
First off I never said the grinch dimmer was junk.I said the programmer was...

Secondly the main issue is my instructions said 1 number and the chip says atmega 88 20pu...

Thirdly the main issue is that the batch file and hex file that RPM sent me with instructions seems buggy.I say this cause there is no directory for me to put these files into.Secondly there is no install of a program as it runs in ms/dos which is weird cause it is written for windows xp.

Fourth is that the programmer is seen by the computer but the red light flashes when I try to program it (the plug I recieved with this kt is buggy too) as it has a notch in it that leads to what as a plug in I have no idea as there is no orinention on the board nor does the plug have a marking for number 1 pin..So this all adds to the confusion as avrdude was supposed to be a program that had an interface not msdos even in it's own write up...So sorry if I disagree as this is not developing anything but rather programing what already exists with great difficulty and getting seriously frustrated with it in the process as it should not be this complicated to do something that is sad to be so easy..So once again any help I can get in this regard would be greatly appreciated.
Thank-you again.
Joe...

Entropy
12-24-2009, 12:25 AM
The red light SHOULD blink when it is programming.

Does the batch file show you the output of avrdude as it's flashing? Do you see the flash/verify progress bars?

I haven't worked with RPM's batch scripts so I can't help you there. Typically the most basic instructions are:

1) Get the .hex file for whatever you want to flash into the AVR (although the flash image can actually be a different format, 95%+ of the time it's Intel Hex - If it's something else RPM will have to help you.)
2) To flash a hex file to a Mega88 using the USBTinyISP:
'avrdude -c usbtiny -p m88 -U flash:w:file.hex'

The USBTinyISP is definately not a piece of junk - I use it all the time!

I'll admit, I do sometimes get the plug orientation wrong. This will cause avrdude to spit out an error. The reason the headers on most AVR circuit boards aren't keyed is due to cost and board real estate reasons. (10-pin headers are usually in a keyed socket, 6-pin headers rarely are as the 6-pin format is used to save costs and board space) The plug on the USBTinyISP is keyed for those cases where the 6-pin header is a keyed socket, but 90% of the time the target board is not keyed.

RPM
12-24-2009, 01:27 AM
Joe,

Don't get frustrated... it's actually a very good programmer, but it takes a few things to get it setup correctly.

Here's the text of the batch file I use to program the DMX dongle... it's just one line

avrdude -p m88 -c usbtiny -U flash:w:dmx_dongle.hex -V -u -U efuse:w:0xff:m -U hfuse:w:0xdd:m -U lfuse:w:0xff:m

You should put this file and the "dmx_dongle.hex" file in the folder that contains AVRdude and either run it from DOS, or it can be run from double clicking it from Windows.

The files to setup your programmer can be downloaded here
http://www.ladyada.net/make/usbtinyisp/download.html

You will need to download Avrdude and WinAVR.
You can read more about this here http://www.ladyada.net/make/usbtinyisp/avrdude.html

I initially had some problems getting my programmer to work, and it ended up being I had to use the Windows USBtinyISP driver v1.10 for the version of WinAVR I had installed.

One thing that helped my sort out my problems was the help page here http://www.ladyada.net/make/usbtinyisp/help.html

Robert

Warlock
12-24-2009, 08:55 AM
OK issues are still..

Avrdude open,I click on the dos program you gave me and the green light is on steady...Red light flashes then disappears with no heart beat to the dmx dongle at all.I got no confirmation that the programmer is finished nor can I see anything on the dos screen as it goes by way to fast for me to see anything...
Not sure what is still going on with this but it seems for me like it wants to be either a: very picky or b: not work correctly :-(..Not sure why cause everything else seems fine..I did all other checks to the programmer and still nothing...SO if someone can help we can do this via the chat that would be great so please let me know..
Thanks again.
Joe...

Warlock
12-24-2009, 09:10 AM
I finally got this crazy thing to work...

What had happened is simply this...

The instructions are not very clear but there is some code you have to punch in to get this to start...Funny thing is in the instructions this line of code is omitted till you go to the help page where looking at the scren it says to type in
"avrdude -c usbtiny -p m8"...Once this line was typed in away we went and the dongle is fully programmed and ready to roll :-)..
Thanks to all who helped me out with this very frustrating problem..It is greatly appreciated :-)

Joe...

Entropy
12-24-2009, 11:09 AM
Um, those exact instructions were in RPM's post three posts above?

Looks like RPM's batch file broke somehow?

Warlock
12-24-2009, 11:41 AM
I wish it was....It was on the help page but not in text..I seen it in one of the pics.I simply tried it as a last resport and it worked...Funny as I never got an error or no communication message at all but in the end it is finally working..The programmer was set up it simply was no pointing to the correct files to begin with..On the help page there is a code line you type in and once that is done it allows you to click on a file so it can be loaded...Once it was an open communication link it loaded fast and was so easy but without that opening code so to speak it never would have worked nor would I have figured it out as I said it wasn't written in any instructions to date except on the help page

Entropy
12-24-2009, 12:51 PM
Which help page? RPM's? Adafruit's? avrdude's?

Warlock
12-24-2009, 03:11 PM
http://www.ladyada.net/make/usbtinyisp/help.html was the page from RPM's links but even then no text about it..I seen it typed in a pic and simply gave it a try and it worked with no issues at all..

Thanks again guys and happy holidays