Allow instruction data to be specified more flexibly, which can be

used to make the instruction input more readable in the config file.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@102 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
bsd 2001-11-21 05:50:59 +00:00
parent e2d6493f91
commit ec7682ac94
3 changed files with 473 additions and 258 deletions

1
avr.c
View File

@ -531,7 +531,6 @@ int avr_write_byte(int fd, AVRPART * p, AVRMEM * mem,
fprintf(stderr, fprintf(stderr,
"avr_write_byte(): write not support for memory type \"%s\"\n", "avr_write_byte(): write not support for memory type \"%s\"\n",
mem->desc); mem->desc);
exit(1);
return -1; return -1;
} }

View File

@ -93,30 +93,59 @@ programmer
vfyled = 17; vfyled = 17;
; ;
/*
part part
id = "1200"; id = "1200";
desc = "AT90S1200"; desc = "AT90S1200";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 64; size = 64;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x00; readback_p1 = 0x00;
readback_p2 = 0xff; readback_p2 = 0xff;
read = "1 0 1 0 0 0 0 0 x x x x x x x x",
"x x a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x x",
"x x a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 1024; size = 1024;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
; ;
; ;
@ -125,25 +154,59 @@ part
id = "2313"; id = "2313";
desc = "AT90S2313"; desc = "AT90S2313";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 128; size = 128;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x80; readback_p1 = 0x80;
readback_p2 = 0x7f; readback_p2 = 0x7f;
read = "1 0 1 0 0 0 0 0 x x x x x x x x",
"x a a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x x",
"x a a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 2048; size = 2048;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x7f; readback_p1 = 0x7f;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;
memory "lock"
size = 1;
write = "1 0 1 0 1 1 0 0 1 1 1 x x i i x",
"x x x x x x x x x x x x x x x x";
; ;
; ;
@ -152,25 +215,54 @@ part
id = "2333"; id = "2333";
desc = "AT90S2333"; desc = "AT90S2333";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 128; size = 128;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x00; readback_p1 = 0x00;
readback_p2 = 0xff; readback_p2 = 0xff;
read = "1 0 1 0 0 0 0 0 x x x x x x x x",
"x a a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x x",
"x a a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 2048; size = 2048;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x x x a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
; ;
; ;
@ -179,25 +271,54 @@ part
id = "4433"; id = "4433";
desc = "AT90S4433"; desc = "AT90S4433";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 256; size = 256;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x00; readback_p1 = 0x00;
readback_p2 = 0xff; readback_p2 = 0xff;
read = "1 0 1 0 0 0 0 0 x x x x x x x x",
"a a a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x x",
"a a a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 4096; size = 4096;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
; ;
; ;
@ -206,25 +327,54 @@ part
id = "4434"; id = "4434";
desc = "AT90S4434"; desc = "AT90S4434";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 256; size = 256;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x00; readback_p1 = 0x00;
readback_p2 = 0xff; readback_p2 = 0xff;
read = "1 0 1 0 0 0 0 0 x x x x x x x x",
"a a a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x x",
"a a a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 4096; size = 4096;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x x a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
; ;
; ;
@ -233,25 +383,54 @@ part
id = "8515"; id = "8515";
desc = "AT90S8515"; desc = "AT90S8515";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 512; size = 512;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x80; readback_p1 = 0x80;
readback_p2 = 0x7f; readback_p2 = 0x7f;
read = "1 0 1 0 0 0 0 0 x x x x x x x a8",
"a a a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x a8",
"a a a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 8192; size = 8192;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x7f; readback_p1 = 0x7f;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
; ;
; ;
@ -260,25 +439,54 @@ part
id = "8535"; id = "8535";
desc = "AT90S8535"; desc = "AT90S8535";
chip_erase_delay = 20000; chip_erase_delay = 20000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 512; size = 512;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0x00; readback_p1 = 0x00;
readback_p2 = 0xff; readback_p2 = 0xff;
read = "1 0 1 0 0 0 0 0 x x x x x x x a8",
"a a a a a a a a o o o o o o o o";
write = "1 1 0 0 0 0 0 0 x x x x x x x a8",
"a a a a a a a a i i i i i i i i";
; ;
flash memory "flash"
paged = no;
size = 8192; size = 8192;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 20000; max_write_delay = 20000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0x00; readback_p2 = 0x00;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_lo = " 0 1 0 0 0 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write_hi = " 0 1 0 0 1 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
; ;
; ;
@ -287,17 +495,29 @@ part
id = "m103"; id = "m103";
desc = "ATMEGA103"; desc = "ATMEGA103";
chip_erase_delay = 112000; chip_erase_delay = 112000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 4096; size = 4096;
page_size = 0;
num_pages = 0;
min_write_delay = 4000; min_write_delay = 4000;
max_write_delay = 9000; max_write_delay = 9000;
readback_p1 = 0x00; readback_p1 = 0x00;
readback_p2 = 0xff; readback_p2 = 0xff;
read = " 1 0 1 0 0 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write = " 1 1 0 0 0 0 0 0",
" x x x x a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
; ;
flash memory "flash"
paged = yes; paged = yes;
size = 131072; size = 131072;
page_size = 256; page_size = 256;
@ -307,6 +527,11 @@ part
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0x00; readback_p2 = 0x00;
; ;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;
; ;
@ -314,17 +539,29 @@ part
id = "m16"; id = "m16";
desc = "ATMEGA16"; desc = "ATMEGA16";
chip_erase_delay = 9000; chip_erase_delay = 9000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 512; size = 512;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 9000; max_write_delay = 9000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0xff; readback_p2 = 0xff;
read = " 1 0 1 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write = " 1 1 0 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
; ;
flash memory "flash"
paged = yes; paged = yes;
size = 16384; size = 16384;
page_size = 128; page_size = 128;
@ -334,39 +571,42 @@ part
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0xff; readback_p2 = 0xff;
; ;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;
; ;
*/
#------------------------------------------------------------
# ATMega163
#------------------------------------------------------------
part part
id = "m163"; id = "m163";
desc = "ATMEGA163"; desc = "ATMEGA163";
pgm_enable = "1", "0", "1", "0", "1", "1", "0", "0",
"0", "1", "0", "1", "0", "0", "1", "1",
"x", "x", "x", "x", "x", "x", "x", "x",
"x", "x", "x", "x", "x", "x", "x", "x";
chip_erase = "1", "0", "1", "0", "1", "1", "0", "0",
"1", "0", "0", "0", "0", "0", "0", "0",
"x", "x", "x", "x", "x", "x", "x", "x",
"x", "x", "x", "x", "x", "x", "x", "x";
chip_erase_delay = 32000; chip_erase_delay = 32000;
memory "eeprom" pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
"x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 512; size = 512;
min_write_delay = 4000; min_write_delay = 4000;
max_write_delay = 4000; max_write_delay = 4000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0xff; readback_p2 = 0xff;
read = " 1 0 1 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read = "1", "0", "1", "0", "0", "0", "0", "0", write = " 1 1 0 0 0 0 0 0",
"x", "x", "x", "x", "x", "x", "x", "a8", " x x x x x x x a8",
"a7", "a6", "a5", "a4", "a3", "a2", "a1", "a0", " a7 a6 a5 a4 a3 a2 a1 a0",
"o", "o", "o", "o", "o", "o", "o", "o"; " i i i i i i i i";
write = "1", "1", "0", "0", "0", "0", "0", "0",
"x", "x", "x", "x", "x", "x", "x", "a8",
"a7", "a6", "a5", "a4", "a3", "a2", "a1", "a0",
"i", "i", "i", "i", "i", "i", "i", "i";
; ;
memory "flash" memory "flash"
paged = yes; paged = yes;
@ -377,130 +617,102 @@ part
max_write_delay = 16000; max_write_delay = 16000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0xff; readback_p2 = 0xff;
read_lo = " 0 0 1 0 0 0 0 0",
" x x x a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_lo = "0", "0", "1", "0", "0", "0", "0", "0", read_hi = " 0 0 1 0 1 0 0 0",
"x", "x", "x", "a12", "a11", "a10", "a9", "a8", " x x x a12 a11 a10 a9 a8",
"a7", "a6", "a5", "a4", "a3", "a2", "a1", "a0", " a7 a6 a5 a4 a3 a2 a1 a0",
"o", "o", "o", "o", "o", "o", "o", "o"; " o o o o o o o o";
read_hi = "0", "0", "1", "0", "1", "0", "0", "0", loadpage_lo = " 0 1 0 0 0 0 0 0",
"x", "x", "x", "a12", "a11", "a10", "a9", "a8", " x x x x x x x x",
"a7", "a6", "a5", "a4", "a3", "a2", "a1", "a0", " x x a5 a4 a3 a2 a1 a0",
"o", "o", "o", "o", "o", "o", "o", "o"; " i i i i i i i i";
loadpage_lo = "0", "1", "0", "0", "0", "0", "0", "0", loadpage_hi = " 0 1 0 0 1 0 0 0",
"x", "x", "x", "x", "x", "x", "x", "x", " x x x x x x x x",
"x", "x", "a5", "a4", "a3", "a2", "a1", "a0", " x x a5 a4 a3 a2 a1 a0",
"i", "i", "i", "i", "i", "i", "i", "i"; " i i i i i i i i";
loadpage_hi = "0", "1", "0", "0", "1", "0", "0", "0", writepage = " 0 1 0 0 1 1 0 0",
"x", "x", "x", "x", "x", "x", "x", "x", " x x x a12 a11 a10 a9 a8",
"x", "x", "a5", "a4", "a3", "a2", "a1", "a0", " a7 a6 x x x x x x",
"i", "i", "i", "i", "i", "i", "i", "i"; " x x x x x x x x";
writepage = "0", "1", "0", "0", "1", "1", "0", "0",
"x", "x", "x", "a12", "a11", "a10", "a9", "a8",
"a7", "a6", "x", "x", "x", "x", "x", "x",
"x", "x", "x", "x", "x", "x", "x", "x";
; ;
memory "lfuse" memory "lfuse"
size = 1; size = 1;
min_write_delay = 2000; min_write_delay = 2000;
max_write_delay = 2000; max_write_delay = 2000;
read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
"x x x x x x x x o o x x o o o o";
read = "0", "1", "0", "1", "0", "0", "0", "0", write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
"0", "0", "0", "0", "0", "0", "0", "0", "x x x x x x x x i i 1 1 i i i i";
"x", "x", "x", "x", "x", "x", "x", "x",
"o", "o", "x", "x", "o", "o", "o", "o";
write = "1", "0", "1", "0", "1", "1", "0", "0",
"1", "0", "1", "0", "0", "0", "0", "0",
"x", "x", "x", "x", "x", "x", "x", "x",
"i", "i", "1", "1", "i", "i", "i", "i";
; ;
memory "hfuse" memory "hfuse"
size = 1; size = 1;
min_write_delay = 2000; min_write_delay = 2000;
max_write_delay = 2000; max_write_delay = 2000;
read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x x x x x 1 o o o";
read = "0", "1", "0", "1", "1", "0", "0", "0", write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
"0", "0", "0", "0", "1", "0", "0", "0", "x x x x x x x x 1 1 1 1 1 i i i";
"x", "x", "x", "x", "x", "x", "x", "x",
"x", "x", "x", "x", "1", "o", "o", "o";
write = "1", "0", "1", "0", "1", "1", "0", "0",
"1", "0", "1", "0", "1", "0", "0", "0",
"x", "x", "x", "x", "x", "x", "x", "x",
"1", "1", "1", "1", "1", "i", "i", "i";
; ;
memory "lock" memory "lock"
size = 1; size = 1;
min_write_delay = 2000; min_write_delay = 2000;
max_write_delay = 2000; max_write_delay = 2000;
read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
"x x x x 0 x x x x x o o o o o o";
read = "0", "1", "0", "1", "1", "0", "0", "0", write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
"0", "0", "0", "0", "0", "0", "0", "0", "x x x x x x x x 1 1 i i i i i i";
"x", "x", "x", "x", "0", "x", "x", "x",
"x", "x", "o", "o", "o", "o", "o", "o";
write = "1", "0", "1", "0", "1", "1", "0", "0",
"1", "1", "1", "x", "x", "x", "x", "x",
"x", "x", "x", "x", "x", "x", "x", "x",
"1", "1", "i", "i", "i", "i", "i", "i";
; ;
memory "signature" memory "signature"
size = 3; size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
read = "0", "0", "1", "1", "0", "0", "0", "0", "x x x x x x a1 a0 o o o o o o o o";
"x", "x", "x", "x", "x", "x", "x", "x",
"x", "x", "x", "x", "x", "x", "a1", "a0",
"o", "o", "o", "o", "o", "o", "o", "o";
; ;
memory "calibration" memory "calibration"
size = 1; size = 1;
read = "0", "0", "1", "1", "1", "0", "0", "0", read = "0 0 1 1 1 0 0 0 x x x x x x x x",
"x", "x", "x", "x", "x", "x", "x", "x", "0 0 0 0 0 0 0 0 o o o o o o o o";
"0", "0", "0", "0", "0", "0", "0", "0",
"o", "o", "o", "o", "o", "o", "o", "o";
; ;
/*
instructions
instr "pe", "programming enable" [ "1010 1100", "0101 0011", "xxxx xxxx", "xxxx xxxx" ];
instr "ce", "chip erase" [ "1010 1100", "100x xxxx", "xxxx xxxx", "xxxx xxxx" ];
instr "rpm", "read program memory" [ "0010 H000", "xxxa aaaa", "bbbb bbbb", "oooo oooo" ];
instr "lpmp" "load program memory page" [ "0100 H000", "xxxx xxxx", "xxbb bbbb", "iiii iiii" ];
instr "wpmp", "write program memory page" [ "0100 1100", "xxxa aaaa", "bbxx xxxx", "xxxx xxxx" ];
instr "rep", "read eeprom memory" [ "1010 0000", "xxxx xxxa", "bbbb bbbb", "oooo oooo" ];
instr "wep", "write eeprom memory" [ "1100 0000", "xxxx xxxa", "bbbb bbbb", "iiii iiii" ];
instr "rlb", "read lock bits" [ "0101 1000", "0000 0000", "xxxx 0xxx", "xxoo oooo" ];
instr "wlb", "write lock bits" [ "1010 1100", "111x xxxx", "xxxx xxxx", "11ii iiii" ];
instr "rsb", "read signature byte" [ "0011 0000", "xxxx xxxx", "xxxx xxbb", "oooo oooo" ];
instr "wfb", "write fuse bits" [ "1010 1100", "1010 0000", "xxxx xxxx", "ii11 iiii" ];
instr "wfhb", "write fuse high bits" [ "1010 1100", "1010 1000", "xxxx xxxx", "1111 1iii" ];
instr "rfb", "read fuse bits" [ "0101 0000", "0000 0000", "xxxx xxxx", "ooxx oooo" ];
instr "rfhb", "read fuse high bits" [ "0101 1000", "0000 1000", "xxxx xxxx", "xxxx 1ooo" ];
instr "rcb", "read calibration byte" [ "0011 1000", "xxxx xxxx", "0000 0000", "oooo oooo" ];
;
*/
; ;
/*
part part
id = "m8"; id = "m8";
desc = "ATMEGA8"; desc = "ATMEGA8";
chip_erase_delay = 9000; chip_erase_delay = 9000;
eeprom pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
paged = no; "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0",
"x x x x x x x x x x x x x x x x";
memory "eeprom"
size = 512; size = 512;
page_size = 0;
num_pages = 0;
min_write_delay = 9000; min_write_delay = 9000;
max_write_delay = 9000; max_write_delay = 9000;
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0xff; readback_p2 = 0xff;
read = " 1 0 1 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write = " 1 1 0 0 0 0 0 0",
" x x x x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
; ;
flash memory "flash"
paged = yes; paged = yes;
size = 8192; size = 8192;
page_size = 64; page_size = 64;
@ -510,6 +722,10 @@ part
readback_p1 = 0xff; readback_p1 = 0xff;
readback_p2 = 0xff; readback_p2 = 0xff;
; ;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 x x x x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;
; ;
*/

View File

@ -315,13 +315,6 @@ part_parm :
int opnum; int opnum;
OPCODE * op; OPCODE * op;
if (lsize(string_list) != 32) {
fprintf(stderr,
"%s: error at %s:%d: only %d bits specified, need 32\n",
progname, infile, lineno, lsize(string_list));
exit(1);
}
opnum = which_opcode($1); opnum = which_opcode($1);
op = avr_new_opcode(); op = avr_new_opcode();
parse_cmdbits(op); parse_cmdbits(op);
@ -399,13 +392,6 @@ mem_spec :
int opnum; int opnum;
OPCODE * op; OPCODE * op;
if (lsize(string_list) != 32) {
fprintf(stderr,
"%s: error at %s:%d: only %d bits specified, need 32\n",
progname, infile, lineno, lsize(string_list));
exit(1);
}
opnum = which_opcode($1); opnum = which_opcode($1);
op = avr_new_opcode(); op = avr_new_opcode();
parse_cmdbits(op); parse_cmdbits(op);
@ -498,86 +484,100 @@ static int parse_cmdbits(OPCODE * op)
char * e; char * e;
char * q; char * q;
int len; int len;
char * s, *brkt;
bitno = 31; bitno = 32;
while (lsize(string_list)) { while (lsize(string_list)) {
t = lrmv_n(string_list, 1); t = lrmv_n(string_list, 1);
len = strlen(t->value.string); s = strtok_r(t->value.string, " ", &brkt);
while (s != NULL) {
if (len == 0) { bitno--;
fprintf(stderr, if (bitno < 0) {
"%s: error at %s:%d: invalid bit specifier \"\"\n",
progname, infile, lineno);
exit(1);
}
ch = t->value.string[0];
if (len == 1) {
switch (ch) {
case '1':
op->bit[bitno].type = AVR_CMDBIT_VALUE;
op->bit[bitno].value = 1;
op->bit[bitno].bitno = bitno % 8;
break;
case '0':
op->bit[bitno].type = AVR_CMDBIT_VALUE;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
case 'x':
op->bit[bitno].type = AVR_CMDBIT_IGNORE;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
case 'a':
op->bit[bitno].type = AVR_CMDBIT_ADDRESS;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = 8*(bitno/8) + bitno % 8;
break;
case 'i':
op->bit[bitno].type = AVR_CMDBIT_INPUT;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
case 'o':
op->bit[bitno].type = AVR_CMDBIT_OUTPUT;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
default :
fprintf(stderr,
"%s: error at %s:%d: invalid bit specifier '%c'\n",
progname, infile, lineno, ch);
exit(1);
break;
}
}
else {
if (ch == 'a') {
q = &t->value.string[1];
op->bit[bitno].bitno = strtol(q, &e, 0);
if ((e == q)||(*e != 0)) {
fprintf(stderr,
"%s: error at %s:%d: can't parse bit number from \"%s\"\n",
progname, infile, lineno, q);
exit(1);
}
op->bit[bitno].type = AVR_CMDBIT_ADDRESS;
op->bit[bitno].value = 0;
}
else {
fprintf(stderr, fprintf(stderr,
"%s: error at %s:%d: invalid bit specifier \"%s\"\n", "%s: error at %s:%d: too many opcode bits for instruction\n",
progname, infile, lineno, t->value.string); progname, infile, lineno);
exit(1); exit(1);
} }
len = strlen(s);
if (len == 0) {
fprintf(stderr,
"%s: error at %s:%d: invalid bit specifier \"\"\n",
progname, infile, lineno);
exit(1);
}
ch = s[0];
if (len == 1) {
switch (ch) {
case '1':
op->bit[bitno].type = AVR_CMDBIT_VALUE;
op->bit[bitno].value = 1;
op->bit[bitno].bitno = bitno % 8;
break;
case '0':
op->bit[bitno].type = AVR_CMDBIT_VALUE;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
case 'x':
op->bit[bitno].type = AVR_CMDBIT_IGNORE;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
case 'a':
op->bit[bitno].type = AVR_CMDBIT_ADDRESS;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = 8*(bitno/8) + bitno % 8;
break;
case 'i':
op->bit[bitno].type = AVR_CMDBIT_INPUT;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
case 'o':
op->bit[bitno].type = AVR_CMDBIT_OUTPUT;
op->bit[bitno].value = 0;
op->bit[bitno].bitno = bitno % 8;
break;
default :
fprintf(stderr,
"%s: error at %s:%d: invalid bit specifier '%c'\n",
progname, infile, lineno, ch);
exit(1);
break;
}
}
else {
if (ch == 'a') {
q = &s[1];
op->bit[bitno].bitno = strtol(q, &e, 0);
if ((e == q)||(*e != 0)) {
fprintf(stderr,
"%s: error at %s:%d: can't parse bit number from \"%s\"\n",
progname, infile, lineno, q);
exit(1);
}
op->bit[bitno].type = AVR_CMDBIT_ADDRESS;
op->bit[bitno].value = 0;
}
else {
fprintf(stderr,
"%s: error at %s:%d: invalid bit specifier \"%s\"\n",
progname, infile, lineno, s);
exit(1);
}
}
s = strtok_r(NULL, " ", &brkt);
} }
free_token(t); free_token(t);
bitno--;
} /* while */ } /* while */