This is a jajor re-write of the programming algorithms. The Atmel

serial programming instructions are not very orthoganal, i.e., the
"read fuse bits" instruction on an ATMega103 is an entirely different
opcode and data format from the _same_ instruction for an ATMega163!
Thus, it becomes impossible to have a single instruction encoding
(varying the data) across the chip lines.

This set of changes allows and requires instruction encodings to be
defined on a per-part basis within the configuration file.  Hopefully
I've defined the encoding scheme in a general enough way so it is
useful in describing the instruction formats for yet-to-be invented
Atmel chips.  I've tried hard to make it match very closely with the
specification in Atmel's data sheets for their parts.  It's a little
more verbose than what I initially hoped for, but I've tried to keep
it as concise as I could, while still remaining reasonably flexible.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@100 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean
2001-11-21 02:46:55 +00:00
parent f1af5d3981
commit fb233af934
12 changed files with 972 additions and 535 deletions

View File

@@ -520,7 +520,7 @@ int fmt_autodetect(char * fname)
int fileio(int op, char * filename, FILEFMT format,
struct avrpart * p, int memtype, int size)
struct avrpart * p, char * memtype, int size)
{
int rc;
FILE * f;
@@ -528,6 +528,15 @@ int fileio(int op, char * filename, FILEFMT format,
unsigned char * buf;
struct fioparms fio;
int i;
AVRMEM * mem;
mem = avr_locate_mem(p, memtype);
if (mem == NULL) {
fprintf(stderr,
"fileio(): memory type \"%s\" not configured for device \"%s\"\n",
memtype, p->desc);
return -1;
}
rc = fileio_setparms(op, &fio);
if (rc < 0)
@@ -554,9 +563,9 @@ int fileio(int op, char * filename, FILEFMT format,
}
/* point at the requested memory buffer */
buf = p->mem[memtype].buf;
buf = mem->buf;
if (fio.op == FIO_READ)
size = p->mem[memtype].size;
size = mem->size;
if (fio.op == FIO_READ) {
/* 0xff fill unspecified memory */