Basic AVR questions
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Basic AVR questions
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
mc
Guest





Posted: Sun Dec 26, 2004 5:04 am    Post subject: Basic AVR questions Reply with quote

(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 :)
Back to top
Prime
Guest





Posted: Tue Dec 28, 2004 2:25 am    Post subject: Re: Basic AVR questions Reply with quote

"mc" <mc_no_spam@uga.edu> wrote in
news:41ce04fa$1@mustang.speedfactory.net:

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

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.

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

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.

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

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 : www.avrbeginners.net an invaluable help when I
started using AVRs, also when it is back up www.avrfreaks.net has
application notes, projects etc. It also has a pretty friendly and helpfull
web forum.

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

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.
Back to top
Rich Webb
Guest





Posted: Tue Dec 28, 2004 7:34 am    Post subject: Re: Basic AVR questions Reply with quote

On Sat, 25 Dec 2004 19:04:40 -0500, "mc" <mc_no_spam@uga.edu> wrote:

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

Pretty much, yes.

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

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... <cough>

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 (www.avrfreaks.net) has some good plans but
they're still down for maintenance. Should be back this week.

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

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.

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

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
Back to top
Prime
Guest





Posted: Tue Dec 28, 2004 1:45 pm    Post subject: Re: Basic AVR questions Reply with quote

Mike Harrison <mike@whitewing.co.uk> wrote in
news:8ll2t0dl2bucc6frsaj60vsmq8c9vatd87@4ax.com:

Quote:
On Tue, 28 Dec 2004 02:25:55 +0000 (UTC), Prime
afra@666aurigae.demon.co.uk> wrote:

"mc" <mc_no_spam@uga.edu> wrote in
news:41ce04fa$1@mustang.speedfactory.net:

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

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.

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

IIRC reasonably easy, however the problem is that this uses an AVR
itself, which will need to be programmed.
Not necessarily - you can make an AVR programmer with a PIC, or any
other micro.

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.

Quote:
At a pinch you could probably do it off the parallel port

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.

Quote:
(3) Would such a programmer be essentially universal (for AVRs)? Or
do they have different programming algorithms?
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.

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 :)
Back to top
Mike Harrison
Guest





Posted: Tue Dec 28, 2004 5:53 pm    Post subject: Re: Basic AVR questions Reply with quote

On Tue, 28 Dec 2004 02:25:55 +0000 (UTC), Prime <afra@666aurigae.demon.co.uk> wrote:

Quote:
"mc" <mc_no_spam@uga.edu> wrote in
news:41ce04fa$1@mustang.speedfactory.net:

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

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.

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

IIRC reasonably easy, however the problem is that this uses an AVR itself,
which will need to be programmed.
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
Quote:

(3) Would such a programmer be essentially universal (for AVRs)? Or
do they have different programming algorithms?
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.
Back to top
Mike Harrison
Guest





Posted: Tue Dec 28, 2004 5:55 pm    Post subject: Re: Basic AVR questions Reply with quote

On Tue, 28 Dec 2004 02:34:53 GMT, Rich Webb <bbew.ar@mapson.nozirev.ten> wrote:

Quote:
On Sat, 25 Dec 2004 19:04:40 -0500, "mc" <mc_no_spam@uga.edu> wrote:

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

Pretty much, yes.

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

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... <cough

...or the 'use reset as IO', or clock config bits on some devices. AVRISP is occasionally good at
trashing these.
Back to top
Everett M. Greene
Guest





Posted: Tue Dec 28, 2004 7:54 pm    Post subject: Re: Basic AVR questions Reply with quote

Prime <afra@666aurigae.demon.co.uk> writes:
Quote:
"mc" <mc_no_spam@uga.edu> wrote

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

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 doubt check the data sheets available on Atmel's site.

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.
Back to top
Prime
Guest





Posted: Tue Dec 28, 2004 7:54 pm    Post subject: Re: Basic AVR questions Reply with quote

"mc" <mc_no_spam@uga.edu> wrote in
news:41d194c9$1@mustang.speedfactory.net:

Quote:

"Prime" <afra@666aurigae.demon.co.uk> wrote in message
news:Xns95CD8BF31CB5primeaurigae@158.152.254.254...

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

IIRC reasonably easy, however the problem is that this uses an AVR
itself, which will need to be programmed.

Not necessarily - you can make an AVR programmer with a PIC, or any
other micro.

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.

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

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

Quote:
At a pinch you could probably do it off the parallel port

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.

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?

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.
Back to top
mc
Guest





Posted: Tue Dec 28, 2004 9:52 pm    Post subject: Re: Basic AVR questions Reply with quote

"Mike Harrison" <mike@whitewing.co.uk> wrote in message
news:8ll2t0dl2bucc6frsaj60vsmq8c9vatd87@4ax.com...
Quote:
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.


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?
Back to top
mc
Guest





Posted: Tue Dec 28, 2004 9:54 pm    Post subject: Re: Basic AVR questions Reply with quote

"Prime" <afra@666aurigae.demon.co.uk> wrote in message
news:Xns95CD8BF31CB5primeaurigae@158.152.254.254...

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

IIRC reasonably easy, however the problem is that this uses an AVR
itself, which will need to be programmed.

Not necessarily - you can make an AVR programmer with a PIC, or any
other micro.

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.

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

Quote:
At a pinch you could probably do it off the parallel port

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.

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?
Back to top
Rich Webb
Guest





Posted: Wed Dec 29, 2004 2:33 am    Post subject: Re: Basic AVR questions Reply with quote

On Tue, 28 Dec 2004 11:54:05 PST, mojaveg@mojaveg.iwvisp.com (Everett M.
Greene) wrote:

Quote:
Prime <afra@666aurigae.demon.co.uk> writes:
"mc" <mc_no_spam@uga.edu> wrote

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

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 doubt check the data sheets available on Atmel's site.

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.

Right -- most of the chips are <= 64K address space so 16 bits are
sufficient.

The hardware multiplier was introduced with the ATmega chips.

--
Rich Webb Norfolk, VA
Back to top
Ulf Samuelsson
Guest





Posted: Wed Dec 29, 2004 8:02 pm    Post subject: Re: Basic AVR questions Reply with quote

"mc" <mc_no_spam@uga.edu> skrev i meddelandet
news:41ce04fa$1@mustang.speedfactory.net...
Quote:
(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 :)


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.
Back to top
mc
Guest





Posted: Thu Dec 30, 2004 12:14 am    Post subject: Re: Basic AVR questions Reply with quote

"Ulf Samuelsson" <ulf@NOSPAMatmel.com> wrote in message
news:cquhqf$olp$1@public2.atmel-nantes.fr...

Quote:
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.
....
There are a free gnu C compiler, and a free IAR C compiler limited to 4
kB.


Many thanks. I didn't know about the free IAR C.
Back to top
mc
Guest





Posted: Thu Dec 30, 2004 12:18 am    Post subject: Re: Basic AVR questions Reply with quote

"mc" <mc_no_spam@uga.edu> wrote in message
news:41d30704$1@mustang.speedfactory.net...
Quote:
"Ulf Samuelsson" <ulf@NOSPAMatmel.com> wrote in message
news:cquhqf$olp$1@public2.atmel-nantes.fr...

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.
...
There are a free gnu C compiler, and a free IAR C compiler limited to 4
kB.

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?
Back to top
Rich Webb
Guest





Posted: Thu Dec 30, 2004 7:35 am    Post subject: Re: Basic AVR questions Reply with quote

On Wed, 29 Dec 2004 14:14:09 -0500, "mc" <mc_no_spam@uga.edu> wrote:

Quote:
"Ulf Samuelsson" <ulf@NOSPAMatmel.com> wrote in message
news:cquhqf$olp$1@public2.atmel-nantes.fr...

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.
...
There are a free gnu C compiler, and a free IAR C compiler limited to 4
kB.


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

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.

http://www.imagecraft.com/software/

--
Rich Webb Norfolk, VA
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB