Basic AVR questions

(1) Do all AVRs have the same instruction set? (Except obviously for instructions that refer to things that are not there.)

(2) How easy is it to make an AVR programmer that is compatible with AVR Studio?

(3) Would such a programmer be essentially universal (for AVRs)? Or do they have different programming algorithms?

I'm getting a bit tired of 500 kinds of PICs, all different :)

Reply to
mc
Loading thread data ...

"mc" wrote in news:41ce04fa$ snipped-for-privacy@mustang.speedfactory.net:

I believe that they all have core instruction set common to all, though I also believe that the later AVRs have some instructions that the earlier ones don't. If in douby check the data sheets available on Atmel's site.

IIRC reasonably easy, however the problem is that this uses an AVR itself, which will need to be programmed. To do this you will need another programmer. You can build a paralell port ISP for a few pounds/dollars/ whatever :) To use this you will need an external programming app, Pony Prog seems to be the most popular.

I believe that most the AVRs are capabale of being programmed with the ISP programmer (as talked about in ans to 2). Though I must confess I have only used the Mega AVRs, the very small 8 pin tinys may not be ISP programable.

If you are just starting out, it may be worth you buying one of the AVR starter kits (STK200, STK300, STK500), as they are generally good value for money.

I found avrbeginners :

formatting link
an invaluable help when I started using AVRs, also when it is back up
formatting link
has application notes, projects etc. It also has a pretty friendly and helpfull web forum.

When I was just getting back into electronics last year, I looked at PIC and decided that I didn't like the look of the thing from a programmers perspective, and felt much more at home with AVR, as it was more like the stuff that I had done in the past (6809/68000). Nothing wrong with the PIC as a chip if it does what you want tho.

Hope that helped.

Phill.

Reply to
Prime

Pretty much, yes.

It's not hard but consider that Atmel's AVR ISP is only $29 from DigiKey (and others) before setting out to make one. The STK500 is down to $79 and it can also do in-system programming (i.e., of a device on another board) as well as serial or parallel programming on itself.

The advantage of the STK500 is that it can do parallel programming if needed, say if somebody accidentally reset the "enable serial programming" fuse on a chip. Not that *I've* ever done that...

That said, if you google for something like "avr programmer build OR make" you can find quite a few resources. Some are rather out of date, though. The AVR Freaks site

formatting link
has some good plans but they're still down for maintenance. Should be back this week.

Universal for all the AVR devices that support in-system serial programming. One of the 8-pin devices doesn't, the ATtiny28 (BTSOOM why not that one), and (I think) one or two of the older AT90 chips.

I feel your pain. I got tired of trying to squeeze everything through that one W register, too.

There are, very broadly, three AVR families that share the base instruction set. The original AT90 chips are the "ancestors" and are being phased out. The ATmega series adds some features and a few extended instructions (but the base set is still supported). On the other end are the ATtiny chips that have very limited or no SRAM beyond the 32 machine registers and a separate hardware stack. Same instruction set, though.

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

Not necessarily - you can make an AVR programmer with a PIC, or any other micro. At a pinch you could probably do it off the parallel port

There are differences, mostly to do with configuration fuses - like PICs, they are similar, but with a few device-specifics. Unfortunately config programming on AVRs is much worse than PICs in that there is no standard for embedding config data into the hex file, so the programmer needs to have a way to input all the options - a complete mess.

Reply to
Mike Harrison

..or the 'use reset as IO', or clock config bits on some devices. AVRISP is occasionally good at trashing these.

Reply to
Mike Harrison

Mike Harrison wrote in news: snipped-for-privacy@4ax.com:

But IIRC all the designs out there on the net for making "AVR studio compatible devices" which is what the OP asked about use AVRs themselves.

If you note (in the part you snipped) I did also say that there where paralell port programmers which can be built and do not need an AVR. They are esntially a LS buffer chip and a couple of discreetes.

This may be but the PROGRAMMER is pretty universal which is what the OP asked about. IE The same hardware/software can pretty much be used to program any AVR.

Yes you may have to set the config fuses manually, but for the most part these come out of the factory with sensible defaults. You do for the most part have to re-compile code when moving from one device to another but I would assume that this would probably be true for most microcontroler families.

Prime....not wanting to start an AVR vs PIC flamewar :)

Reply to
Prime

That sounds like a show-stopper. Looking around, I see that despite the quirky architecture, the PIC has lots of tools, including free compilers for C, Pascal, and Basic. I've just read the MikroPascal manual and like the way these people think. Has anybody here actually used their product? Also, I presume HiTech PICC Lite is well regarded... right?

Reply to
mc

Right, but in fact I have access to a universal programmer at work, so that's not a serious obstacle.

Thanks; I did that with the PIC long ago but have not kept up with whether they work well on modern, fast PCs. Do they?

Reply to
mc

Being involved in this exercise at the moment, the "8-bit AVR instruction set" document has several instructions with the indication "not implemented for devices with 2-bytes [sic] PC". These include EICALL, EIJMP, LPM, and SPM which allow access to 22-bits of memory addressing range and several variants of MUL instructions.

Reply to
Everett M. Greene

"mc" wrote in news:41d194c9$ snipped-for-privacy@mustang.speedfactory.net:

Ahhh that's cool if it will program AVRs :)

The one I made works fine on an Athlon XP 1800, and the other I have, same design but bought with my STK-300, works fine on my XP 3200 :) So I'd say yes. Though I must replace the 74LS in the one I made with a

74HC, as the LS won't let me program at 3.3v, the HC will.

So it should work as long as you have a real paralell port, I have heard that people have problems with USB->Paralell adapters tho.

Phill.

Reply to
Prime

Right -- most of the chips are

Reply to
Rich Webb

"mc" skrev i meddelandet news:41ce04fa$ snipped-for-privacy@mustang.speedfactory.net...

they

Why don't you get an STK500 Dev kit. Should be cheap enough and contains a programmer which gets updated with every new release of AVR Studio and is thus guaranteed by Atmel.

This can be used to program an AVR chip on the kit, or can be used as a programmer for your own target board.

It is very easy to make a project in AVR Studio which defines the hex files and the fuse/protection bits and you will have very good turnaround time for programming..

Since you can bring out all the I/O it should be fairly easy to get going.

There are a free gnu C compiler, and a free IAR C compiler limited to 4 kB.

--
Best Regards
Ulf at atmel dot com
These comments are intended to be my own opinion and they
may, or may not be shared by my employer, Atmel Sweden.
Reply to
Ulf Samuelsson

...

Many thanks. I didn't know about the free IAR C.

Reply to
mc

All I can find at IAR is a free C compiler limited to 30 days. Is there a size-limited one that doesn't expire?

Reply to
mc

Imagecraft also has a demo version. It, also, is size limited to 4K after a period of time (45 days IIRC). It's a lot less expensive than the IAR product and a lot more transparent wrt the status of bugs, their fixes, etc. The principle developer (Hi, Richard!) drops by this usenet group, as well.

formatting link

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

'Tis true, I hang around here :-)

--
// richard
http://www.imagecraft.com
Reply to
Richard M.

I'm not sure about this, but look at the Atmel web site, instead. In the case of the TI MSP430, IAR also provides a size-limited C compiler but that particular one (if I have this right) is only present at the TI web site -- IAR itself doesn't deign to carry it on their own site, from my occasional looking there. So, if IAR is being consistent I'd expect the same arrangements with Atmel.

Jon

Reply to
Jonathan Kirwan

Someone asked me to clarify this as he heard conflicting stories, so let me do it here: we are releasing new version of the compilers (V7) and in fact the names of the products will be chnaged to ICCV7 for , which hopefully will cause slightly less confusion than just ICC since another well known compiler company also calls their *command line* compilers ICC. As an aside, the first V6 was released for AVR in

1999. In 5 years, we did not charge an upgrade fee for customers upgrading from different V6 releases. We *strongly* encourage them to buy the annual maintenance for a pittance of $30 but it is not like other vendors where if you don't pay, you are stuck.

Anyway, with V6, the demo is fully functional for 45 days. After which, the demo no longer functions. With the V7 licensing scheme, the demo is also fully functional for 45 days. Afterward, it becomes code size limit to 4K bytes for non-commercial uses.

Hope this is clear.

--
// richard
http://www.imagecraft.com
Reply to
Richard M.

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.