mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-28 15:05:27 +00:00
Fix VCC assertion.
Make the BUFF pin a mask like VCC to allow multiple pins to be asserted at the same time (STK200 has two buffer enable lines). Add the STK200 programmer. Fix EEPROM address line selection for several parts. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@109 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
13
avr.c
13
avr.c
@@ -786,7 +786,7 @@ int avr_signature(int fd, AVRPART * p)
|
||||
*/
|
||||
void avr_powerup(int fd)
|
||||
{
|
||||
ppi_set(fd, PPIDATA, PPI_AVR_VCC); /* power up */
|
||||
ppi_set(fd, PPIDATA, pgm->pinno[PPI_AVR_VCC]); /* power up */
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
@@ -796,7 +796,7 @@ void avr_powerup(int fd)
|
||||
*/
|
||||
void avr_powerdown(int fd)
|
||||
{
|
||||
ppi_clr(fd, PPIDATA, PPI_AVR_VCC); /* power down */
|
||||
ppi_clr(fd, PPIDATA, pgm->pinno[PPI_AVR_VCC]); /* power down */
|
||||
}
|
||||
|
||||
|
||||
@@ -809,9 +809,12 @@ int avr_initialize(int fd, AVRPART * p)
|
||||
int tries;
|
||||
|
||||
avr_powerup(fd);
|
||||
usleep(20000);
|
||||
|
||||
ppi_setpin(fd, pgm->pinno[PIN_AVR_SCK], 0);
|
||||
ppi_setpin(fd, pgm->pinno[PIN_AVR_RESET], 0);
|
||||
usleep(20000);
|
||||
|
||||
ppi_pulsepin(fd, pgm->pinno[PIN_AVR_RESET]);
|
||||
|
||||
usleep(20000); /* 20 ms XXX should be a per-chip parameter */
|
||||
@@ -831,16 +834,16 @@ int avr_initialize(int fd, AVRPART * p)
|
||||
tries = 0;
|
||||
do {
|
||||
rc = avr_program_enable(fd, p);
|
||||
if (rc == 0)
|
||||
if ((rc == 0)||(rc == -1))
|
||||
break;
|
||||
ppi_pulsepin(fd, pgm->pinno[PIN_AVR_SCK]);
|
||||
tries++;
|
||||
} while (tries < 32);
|
||||
} while (tries < 65);
|
||||
|
||||
/*
|
||||
* can't sync with the device, maybe it's not attached?
|
||||
*/
|
||||
if (tries == 32) {
|
||||
if (rc) {
|
||||
fprintf(stderr, "%s: AVR device not responding\n", progname);
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user