Atmel AVR Microcontroller discussion group.
Getting Started - Chuck Hackett - Sep 14 19:32:00 2004
I'm just getting started with Microcontrollers and have decided to select the
AVR line. I'm looking into what I need to purchase to get started. I would
like to do most of my development in C or C++. To that end I plan on
purchasing:
1) STK500 Starter Kit
2) Processor ...
3) ? Other items ?
I have test equipment (sig-gen, meters, scope, etc.).
I will be programming from a Windows environment.
I have seen references to different chip programming methods. Since my use is
for hobby projects I plan on programming each chip in the STK500 and then moving
it to the target board. Are there any 'gotchas' in this plan? Is it easy to
build onto a target board the ability to connect the debugger?
When I get to the point that I need target boards is there an internet based
company you would recommend to have single boards made (etched and screen
printed, I'll stuff them)?
Cheers,
Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Getting Started - Chuck Hackett - Sep 14 19:34:00 2004
... Forgot to add ...
When would you need an ICE unit as opposed to the debug capabilities of the
STK500?
Cheers,
Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: [AVR club] Getting Started - James Russo - Sep 14 19:54:00 2004
Chuck,
Welcome! I think the AVR is a great line to get started with,
especially with all the development tools out there. I too started with
a STK500 and with the button and the lights its a good starting point. I
would also recommend the AVRISP which is simple serial programmer which
people commonly use. It's inexpensive and works well ($29 I think from
digikey) I personally think that moving the chip from the STK500 to the
target for development cycles is too much work. I personally perfer to
setup the target to use the AVRISP and use that. I think there are some
good reasons to have the STK500, and one of them is some fuse
programming can't be done serially. I'm sure some others can comment on
that I've yet to have any issues related to it.
I personally have used Advanced Circuits for boards because they have a
decent student discount ($33/board no minimum with mask/screen both
sides upto 60sq inches). The non-student discount is the same deal per
board, but a min qty of 3.
For GCC and a programming environment check out winavr, and spend some
time here and on avrfreaks.net asking questions.
Cool trains BTW.
take care,
-james
Chuck Hackett wrote:
> I'm just getting started with Microcontrollers and have decided to
> select the
> AVR line. I'm looking into what I need to purchase to get started. I
> would
> like to do most of my development in C or C++. To that end I plan on
> purchasing:
>
> 1) STK500 Starter Kit
> 2) Processor ...
> 3) ? Other items ?
>
> I have test equipment (sig-gen, meters, scope, etc.).
>
> I will be programming from a Windows environment.
>
> I have seen references to different chip programming methods. Since
> my use is
> for hobby projects I plan on programming each chip in the STK500 and
> then moving
> it to the target board. Are there any 'gotchas' in this plan? Is it
> easy to
> build onto a target board the ability to connect the debugger?
>
> When I get to the point that I need target boards is there an internet
> based
> company you would recommend to have single boards made (etched and screen
> printed, I'll stuff them)?
>
> Cheers,
>
> Chuck Hackett
> "Good judgment comes from experience, experience comes from bad
judgment"
> 7.5" gauge Union Pacific Northern (4-8-4) 844
> http://www.whitetrout.net/Chuck
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here
>
<http://us.ard.yahoo.com/SIG=129d63iph/M=298184.5285298.6392945.3001176/D=groups/S=1706554205:HM/EXP=1095291176/A=2352667/R=0/SIG=11t4iivpf/*http://www.netflix.com/Default?mqso=60185359&partid=5285298
>
> ------------------------------------------------------------------------
> *>.

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: [AVR club] Getting Started - David Jones - Sep 14 19:56:00 2004
Hi Chuck,
Just a couple of comments from my first time AVR learning experience
which was very painful.
- Be careful using the in-circuit serial programming mode (with the
STK500 or any other). If you accidently program the wrong oscillator
bits then you can completely lock out the serial programming mode. In
this case you'll need the parrallel programmer of the STK500 to fix it.
This really sucks if you have soldered your device into circuit and were
relyign on the in-circuit programming. It is not adequately documented
anywhere either. This is crazy and almost turned me off AVRs for good.
- The STK500 is not a user friendly beast, it's a devlopment board and
not an idiot proof programmer. You have to connect lots of various
jumpers and leads to make the various chips work. In my case I was
trying to get a Tiny26 working and I found out the hard way you had to
cut and modify the programming leads to make it work. So you buy Atmels
top of the line programmer/development board and it can't even program
one of the popular AVR chips out of the box - insane!. This
documentation was not easy to find, it's burried a few levels into the
help file in the software. Atmel claim they are going to document this
better though.
- Forget WinAVR unless you absolutely can't afford anything else, it's
a nightmare for a beginner. One of the other commercial compilers like
CodeVision is much more user friendly and idiot proof, they just work
first go, and the automatic code generator is great for getting you
started.
Regards
Dave :)
>>> egroupscdh@egro... 15/09/2004 9:32:45 am >>>
I'm just getting started with Microcontrollers and have decided to
select the
AVR line. I'm looking into what I need to purchase to get started. I
would
like to do most of my development in C or C++. To that end I plan on
purchasing:
1) STK500 Starter Kit
2) Processor ...
3) ? Other items ?
I have test equipment (sig-gen, meters, scope, etc.).
I will be programming from a Windows environment.
I have seen references to different chip programming methods. Since my
use is
for hobby projects I plan on programming each chip in the STK500 and
then moving
it to the target board. Are there any 'gotchas' in this plan? Is it
easy to
build onto a target board the ability to connect the debugger?
When I get to the point that I need target boards is there an internet
based
company you would recommend to have single boards made (etched and
screen
printed, I'll stuff them)?
Cheers,
Chuck Hackett
"Good judgment comes from experience, experience comes from bad
judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
RE: [AVR club] Getting Started - stevech - Sep 14 21:47:00 2004
Suggest: PRLLC's AVR mega32 board with the serial port boot loader. And
Codevision C compiler- free code size limited version. This gets you started
for $75 or so. You can grow from there.
-----Original Message-----
From: Chuck Hackett [mailto:egroupscdh@egro...]
Sent: Tuesday, September 14, 2004 4:33 PM
To: Avrclub
Subject: [AVR club] Getting Started
I'm just getting started with Microcontrollers and have decided to select
the
AVR line. I'm looking into what I need to purchase to get started. I would
like to do most of my development in C or C++. To that end I plan on
purchasing:
1) STK500 Starter Kit
2) Processor ...
3) ? Other items ?
I have test equipment (sig-gen, meters, scope, etc.).
I will be programming from a Windows environment.
I have seen references to different chip programming methods. Since my use
is
for hobby projects I plan on programming each chip in the STK500 and then
moving
it to the target board. Are there any 'gotchas' in this plan? Is it easy
to
build onto a target board the ability to connect the debugger?
When I get to the point that I need target boards is there an internet based
company you would recommend to have single boards made (etched and screen
printed, I'll stuff them)?
Cheers,
Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck
Yahoo! Groups Links

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: [AVR club] Getting Started - Zack Widup - Sep 14 22:25:00 2004
On Wed, 15 Sep 2004, David Jones wrote:
> Hi Chuck,
> Just a couple of comments from my first time AVR learning experience
> which was very painful.
>
> - Be careful using the in-circuit serial programming mode (with the
> STK500 or any other). If you accidently program the wrong oscillator
> bits then you can completely lock out the serial programming mode. In
> this case you'll need the parrallel programmer of the STK500 to fix it.
> This really sucks if you have soldered your device into circuit and were
> relyign on the in-circuit programming. It is not adequately documented
> anywhere either. This is crazy and almost turned me off AVRs for good.
The only trouble I've had with AVR's so far is misprogramming of the
oscillator bits. I thik I've finally gotten the hang of the STK500 and
AVR Studio in doing this and I have been doing fine with it for a while
now. But it wasn't the easiest thing to figure out and learn.
> - The STK500 is not a user friendly beast, it's a devlopment board and
> not an idiot proof programmer. You have to connect lots of various
> jumpers and leads to make the various chips work. In my case I was
> trying to get a Tiny26 working and I found out the hard way you had to
> cut and modify the programming leads to make it work. So you buy Atmels
> top of the line programmer/development board and it can't even program
> one of the popular AVR chips out of the box - insane!. This
> documentation was not easy to find, it's burried a few levels into the
> help file in the software. Atmel claim they are going to document this
> better though.
The STK500 is a neat development board. It isn't a simple board like the
MicroEngineering EPIC Plus programmer for PIC's, but it has a lot of
features that make it versatile once you figure out all the jumpers, etc.
I did make a very stupid mistake recently; don't try to program an AVR
when you have two AVR's mounted on the board at once! In my case, it was
a 90S2313 and a Mega16. Both chips survived, but I felt pretty stupid
when I saw what I'd done. :-)
Good luck.
Zack

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: Getting Started - Graham Davies - Sep 15 10:03:00 2004
--- In avrclub@avrc..., "Chuck Hackett" <egroupscdh@W...>
wrote:
> I'm just getting started ...
> I have seen references to
> different chip programming
> methods ...
Are you planning on using the ATmega AVRs or the little ones? If you
are using ATmegas, many of them have a JTAG interface. Using this has
a couple of advantages. First, you are immune from messing up the
oscillator fuses because this interface works even of the oscillator
is not running so you can go back in and fix the fuses. Second, with
AVR Studio you can do in-circuit debugging, which none of the other
methods support. On the downside, you have to give up four pins, buy
a JTAG ICE dongle and the STK500 does not have direct support for
JTAG so you need to wire up an adapter cable (the STK501 has support,
but that's another $80). Also, you need a way to program the fuse
that enables the JTAG interface, which is not programmed when the
MCUs are shipped out my Atmel.
Now, on to the advertising. I am close to completing the development
of a JTAG ICE clone, see http://www.ecrostech.com. If you decide to
go in this direction, please consider this. I have a prototype
available ($34.95) with production in a couple of weeks ($39.95).
For prototype PCBs, I use http://www.BareBonesPCB.com.
Graham.

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
RE: [AVR club] Getting Started - Chuck Hackett - Sep 16 2:40:00 2004
Thanks to all for your recommendations. I think I'll go with the STK500 and
CodeVision (CV) which brings up the following:
1) Mention was made about being careful not to mis-program the oscillator bits.
Since I have not yet programmed an AVR chip, can you tell me what specifically
(CV compiler directive, etc.) NOT to do?
2) As I understand it the AVR uses 'fuses' to control some configuration items.
I assume that once 'programmed' these fuses can not be undone. Again, can you
tell me what NOT to do to avoid accidentally misprogramming one of these?
3) STK500: Note to self: read all documentation first to understand the
appropriate jumper settings for the particular chip to be used :-)
4) James mentioned "Advanced Circuits" as a place to get small numbers of
boards
made. What I forgot to mention is that I do not currently have and software for
producing the files required by folks like Advanced Circuits. I seem to recall
one site that made boards and provided free SW for design (which, I assume, only
worked with their service). Anyone recall the URL for this site? Or other
shareware/low cost circuit/board layout programs?
5) Zack recommends not trying two chips in the STK500 at once. I can see where
that might be a problem ... :-)
6)
> From: Graham Davies
> ....
> Are you planning on using the ATmega AVRs or the little ones?
Since I have a range of projects that will involve a variety of capabilities
I'll probably end up using a wide range of chips. I'm sure that I'll eventually
get into the 'Mega' chips. A common thread is that most of my projects will
require A/D conversion.
Flexibility in my development environment is an important factor ...
> ....
> Now, on to the advertising. I am close to completing the
> development of a JTAG ICE clone, see
> http://www.ecrostech.com. If you decide to go in this
> direction, please consider this.
Thanks, I'll consider that when I get a little further along and get some of the
basics under my belt.
7) One thing I forgot to ask before: One of my projects is an irrigation pump
and filter monitor. Since the site is not manned but has a phone line available
I'd like to have the ability to dial-up an ISP (I currently use EarthLink for
Internet access when I'm traveling) via a modem and send a (text only) email
with log/status data. If possible I would also like to be able to email
commands to the monitor that it would pickup on a scheduled basis. I assume
that this would require SMTP and POP functions as well as a TCP/IP stack and
dialer. Can source code for such a function be had? Or, an external function
card? I'm aware of external function cards that will do this to 10-base-T but I
don't have a LAN available at the site and would like to keep it as simple as
possible.
... And, apparently after looking at my web site, James Russo wrote:
> From: James Russo
> ....
> Cool trains BTW.
Thanks James. Actually, the locomotive you saw in the photo is one of the AVR
projects I have in mind - gathering performance data (pressures, temps, speeds,
forces, etc.) to investigate performance enhancements ... Strictly hobby ...
Sorry this is so long. Thanks again for the guidance.
Cheers,
Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: [AVR club] Getting Started - Graham Davies - Sep 16 12:18:00 2004
--- In avrclub@avrc..., "Chuck Hackett" <egroupscdh@W...>
wrote:
> ... I think I'll go with the STK500 and
> CodeVision (CV) ...
Sounds good if you plan to use a variety of MCU types.
> ... which brings up the following:
> 1) Mention was made about being
> careful not to mis-program the
> oscillator bits ...
> 2) As I understand it the AVR uses
> 'fuses' ... once 'programmed' these
> fuses can not be undone ...
The "oscillator bits" are actually fuses. These fuses are just called
fuses to distinguish them from the Flash program memory. They are not
one-time programmable and can be unprogrammed as well as programmed.
You will only get into trouble with fuses if you program them in such
a way as to lose communication with the chip. The "classic" way of
falling into this hole is to program the oscillator selection fuses
to a different type of oscillator from the one you are using. Then if
you are using serial ISP there is no clock and you can't talk to the
chip to undo the damage. Atmel ships the MCUs with the internal RC
oscillator selected, which always works. Before selecting a different
type, for example an external crystal, be sure it is connected up
properly and has a very high chance of working. As I mentioned, I
side-step this problem by always using ATmega MCUs with a JTAG
interface. Then, you can still fiddle with the fuses as this
interface does not need the MCU clock to run. The clock select fuse
problem goes away and instead you have the JTAG enable fuse problem.
You have to program this fuse before you can use the JTAG interface,
so you need an ISP interface available as well. Argh! Then if you
unprogram this fuse, you will lose touch with the chip again. Nothing
seems quite as simple as it could be, but this is often to ensure
backward compatibility with earlier MCUs.
Graham.

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
JTAG Enable Fuse (was Re: Getting Started) - Graham Davies - Sep 17 14:43:00 2004
--- In avrclub@avrc..., "Graham Davies" <YahooGroups@e...>
wrote:
> ... you need a way to program the fuse
> that enables the JTAG interface, which
> is not programmed when the MCUs are
> shipped out my Atmel ...
WRONG! I checked this against the data sheets and I was wrong. The
JTAGEN fuse *IS* programmed by Atmel. So, when you get the device you
are all ready to start with JTAG programming.
What *ISN'T* programmed is the OCDEN fuse that enables the on-chip
debug stuff. But, you can program that fuse with the JTAG interface
so in fact you can build circuits with only that interface and no ISP
interface at all.
This doesn't change the fact that you have to give up four pins or
pull some pretty fancy tricks. But, as I've said before, writing
software without a debugger is like tightrope walking without a net
and I will avoid it if at all possible. Giveing up four pins seems
like a reasonable trade-off. I suppose if I had to build a system
with a small MCU that didn't have JTAG I would prototype it with a
JTAG-capable MCU, get everything working and then port over. I
realize that this may not work in all cases.
Graham.

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )