02-13-12
So, for today's work, I've finally gotten the chip to talk with the computer. I haven't tried uploading any code but the diagnostic commands I've tried, namely
$avrdude -c usbtiny -p t85
... with:
...and without:
a chip plugged in, both work correctly.
I've followed a few tutorials:
the very beginning and end of
this.
note: I installed the required software (avr-gcc and avrdude) through my package manager so I didn't have to muck about in compiling everything like the previous link exhaustively describes.
I spent a good chunk of time making a little proto-board adapter from the 2x3 6-pin header on the programmer to an 8-pin DIP socket.
In my initial attempts to get the programmer working, I first needed to figure out what the pinout of the standard 6-pin header meant.
I looked at the images and instructions provided
here. The part I found initially confusing was what the pinout in this image but it was unclear from which direction the image was describing the 6-pin female header. It turns out that the pinout of the 6 pins corresponds to the cable being flat with the female header facing down (as would make sense?).
I'm thinking that it would be useful in tutorial tomorrow to have a quick C refresher.
This is where I'm going to spend the next chunk of time figuring out things.
Alex has suggested using a makefile but I haven't looked into it too too deeply yet.
Jim
So here's my interpretation: the avr programmer (i.e. device to get a compiled executable from the laptop into the chip) is built, including a board-pinout-specific adapter. Then running avrdude (a small command-line program) with options to identify (a) the programmer and (b) the chip, it can confirm a connection. Next step is to compile an executable (i.e. an "LED blink" test) and send it to the chip.
Alex: the adaptor puts a resister from +V to RESET, so that the reset is nominally high (i.e. the chip is in its normal state) but still allows the programmer to send it low as needed.
Alex is walking us through a "blink" program in the tutorial.
Aaron uploaded a Makefile for compiling code for this chip, which Alex has modified:
- params for this chip and avr-gcc
- writeflash make target set up for this USB programmer
- (swriteflash for older serial approach)
The programmer:
The chip:
software required:
One of the avr-gcc flags will let us know where the include file
folder is, so that we can include those in blink.c. And the
Makefile gets edited to match 'project' and 'project.c' (i.e. blink).
$ make hex # create project.hex that gets sent to chip
$ make writeflash # build, and send to chip (with everything connected.)