Add a few parameters needed for parallel programming: assignment of

PAGEL and BS2 signals and the disposition of the reset pin
('dedicated' or 'io').


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@202 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
bdean 2003-02-20 14:11:34 +00:00
parent 05efe2725a
commit 9de52d215d
5 changed files with 68 additions and 3 deletions

16
avr.c
View File

@ -57,6 +57,7 @@ AVRPART * avr_new_part(void)
p->id[0] = 0;
p->desc[0] = 0;
p->reset_disposition = RESET_DEDICATED;
p->mem = lcreat(NULL, 0);
@ -1053,6 +1054,15 @@ void avr_mem_display(char * prefix, FILE * f, AVRMEM * m, int type,
}
char * reset_disp_str(int r)
{
switch (r) {
case RESET_DEDICATED : return "dedicated";
case RESET_IO : return "possible i/o";
default : return "<invalid>";
}
}
void avr_display(FILE * f, AVRPART * p, char * prefix, int verbose)
{
@ -1065,9 +1075,15 @@ void avr_display(FILE * f, AVRPART * p, char * prefix, int verbose)
fprintf(f,
"%sAVR Part : %s\n"
"%sChip Erase delay : %d us\n"
"%sPAGEL : P%02X\n"
"%sBS2 : P%02X\n"
"%sRESET disposition : %s\n"
"%sMemory Detail :\n\n",
prefix, p->desc,
prefix, p->chip_erase_delay,
prefix, p->pagel,
prefix, p->bs2,
prefix, reset_disp_str(p->reset_disposition),
prefix);
px = prefix;

View File

@ -1082,6 +1082,9 @@ part
desc = "ATMEGA128";
devicecode = 0xB2;
chip_erase_delay = 9000;
pagel = 0xD7;
bs2 = 0xA0;
reset = dedicated;
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";
@ -1089,6 +1092,8 @@ part
"x x x x x x x x x x x x x x x x";
memory "eeprom"
paged = no; /* leave this "no" */
page_size = 8; /* for parallel programming */
size = 4096;
min_write_delay = 9000;
max_write_delay = 9000;

View File

@ -51,6 +51,11 @@ enum {
AVR_CMDBIT_OUTPUT /* this bit is an output bit */
};
enum { /* these are assigned to reset_disposition of AVRPART */
RESET_DEDICATED, /* reset pin is dedicated */
RESET_IO /* reset pin might be configured as an I/O pin */
};
/*
* serial programming instruction bit specifications
*/
@ -72,6 +77,10 @@ typedef struct avrpart {
char id[AVR_IDLEN]; /* short part name */
int devicecode; /* Atmel STK500 device code */
int chip_erase_delay; /* microseconds */
unsigned char pagel; /* for parallel programming */
unsigned char bs2; /* for parallel programming */
int reset_disposition; /* see RESET_ enums */
OPCODE * op[AVR_OP_MAX]; /* opcodes */
LISTID mem; /* avr memory definitions */

View File

@ -62,20 +62,25 @@ static int parse_cmdbits(OPCODE * op);
%token K_PAGE_SIZE
%token K_PAGED
%token K_BS2
%token K_BUFF
%token K_CHIP_ERASE_DELAY
%token K_DEDICATED
%token K_DESC
%token K_DEVICECODE
%token K_EEPROM
%token K_ERRLED
%token K_FLASH
%token K_ID
%token K_IO
%token K_LOADPAGE
%token K_MAX_WRITE_DELAY
%token K_MIN_WRITE_DELAY
%token K_MISO
%token K_MOSI
%token K_NUM_PAGES
%token K_PAGEL
%token K_PAR
%token K_PART
%token K_PGMLED
@ -331,6 +336,10 @@ part_parms :
;
reset_disposition :
K_DEDICATED | K_IO
;
part_parm :
K_ID TKN_EQUAL TKN_STRING
{
@ -359,6 +368,28 @@ part_parm :
free_token($3);
} |
K_PAGEL TKN_EQUAL TKN_NUMBER
{
current_part->pagel = $3->value.number;
free_token($3);
} |
K_BS2 TKN_EQUAL TKN_NUMBER
{
current_part->bs2 = $3->value.number;
free_token($3);
} |
K_RESET TKN_EQUAL reset_disposition
{
if ($3->primary == K_DEDICATED)
current_part->reset_disposition = RESET_DEDICATED;
else if ($3->primary == K_IO)
current_part->reset_disposition = RESET_IO;
free_token($3);
} |
/*
K_EEPROM { current_mem = AVR_M_EEPROM; }
mem_specs |

View File

@ -117,14 +117,17 @@ SIGN [+-]
bank_size { yylval=NULL; return K_PAGE_SIZE; }
banked { yylval=NULL; return K_PAGED; }
bs2 { yylval=NULL; return K_BS2; }
buff { yylval=NULL; return K_BUFF; }
chip_erase_delay { yylval=NULL; return K_CHIP_ERASE_DELAY; }
dedicated { yylval=new_token(K_DEDICATED); return K_DEDICATED; }
desc { yylval=NULL; return K_DESC; }
devicecode { yylval=NULL; return K_DEVICECODE; }
eeprom { yylval=NULL; return K_EEPROM; }
errled { yylval=NULL; return K_ERRLED; }
flash { yylval=NULL; return K_FLASH; }
id { yylval=NULL; return K_ID; }
io { yylval=new_token(K_IO); return K_IO; }
max_write_delay { yylval=NULL; return K_MAX_WRITE_DELAY; }
min_write_delay { yylval=NULL; return K_MIN_WRITE_DELAY; }
miso { yylval=NULL; return K_MISO; }
@ -133,6 +136,7 @@ num_banks { yylval=NULL; return K_NUM_PAGES; }
num_pages { yylval=NULL; return K_NUM_PAGES; }
page_size { yylval=NULL; return K_PAGE_SIZE; }
paged { yylval=NULL; return K_PAGED; }
pagel { yylval=NULL; return K_PAGEL; }
part { yylval=NULL; return K_PART; }
pgmled { yylval=NULL; return K_PGMLED; }
par { yylval=NULL; return K_PAR; }