|
So the hardware setup is as follows …
Your PC should be connected to your programmer.
If you don't have an AVR programmer, you must get one. They come in many
different variations/prices and may be connected to your PC's serial port,
parallel port or even USB. Have a look around, there are many different
manufacturers or ... hobbyists selling AVR programmers. At this stage,
although it is easy to find the parts and the schematic to build one,
I would not recommend so. Leave it for now and have one that is tested.
As you imagined the programmer programs the micro on the
target board. After programming the micro, your target board may run alone.
The only thing that you have to take care of is the pinout of your programmer,
this is pretty much standard but you never know.
To power up the board and the programmer you should use
a power supply that provides 9V-16/1A DC. It is good practice to power up the
board after you 've plugged everything else in. Also, when you want to
remove the programmer, first remove the power supply.
The next thing you would fancy doing after setting things up
is to program the board. Well, to write code, compile it and download it
you need a text editor, a compiler and a dedicated utility that talks to
the programmer and does the job.
It comes down to two packages WinAVR and AVRStudio.
We
are going to use C for writing the code, it is easy to use and its structure
may look familiar to you. If not, have a look around, you will find tones
of tutorials. The C compiler we will use is the free and mighty gcc. It
is a command line compiler with no IDE so you may use any text editor
to edit the code.
Now,
WinAVR is combined the gcc for AVR, and Programmer’s Notepad. You
cannot just compile with any version of gcc, different targets require
different versions of the compiler. Programmer’s Notepad is a really
handy text editor that can also capture compiler’s output.
AVRStudio
(yes, from ATMEL, yes, it's free) is a complete suite of tools for debugging
your code or simulating its execution on the target micro. Recently a
text editor integrated to the package which is fine to use. Of course,
it comes with a utility for downloading your hex files.
Wait no more download - install - connect !!
|