From 981ee782b4eddd63e62f86016cf56b54d3e7e0af Mon Sep 17 00:00:00 2001 From: "Brian S. Dean" Date: Sat, 23 Nov 2002 00:47:29 +0000 Subject: [PATCH] When getting ready to initiate communications with the AVR device, first pull /RESET low for a short period of time before enabling the buffer chip. This sequence allows the AVR to be reset before the buffer is enabled to avoid a short period of time where the AVR may be driving the programming lines at the same time the programmer tries to. Of course, if a buffer is being used, then the /RESET line from the programmer needs to be directly connected to the AVR /RESET line and not via the buffer chip. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@156 81a1dc3b-b13d-400b-aceb-764788c761c2 --- main.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index a476bb8b..6eeddfe9 100644 --- a/main.c +++ b/main.c @@ -839,10 +839,24 @@ int main(int argc, char * argv []) LED_OFF(fd, pgm->pinno[PIN_LED_PGM]); LED_OFF(fd, pgm->pinno[PIN_LED_VFY]); + + /* + * Prepare to start talking to the connected device - pull reset low + * first, delay a few milliseconds, then enable the buffer. This + * sequence allows the AVR to be reset before the buffer is enabled + * to avoid a short period of time where the AVR may be driving the + * programming lines at the same time the programmer tries to. Of + * course, if a buffer is being used, then the /RESET line from the + * programmer needs to be directly connected to the AVR /RESET line + * and not via the buffer chip. + */ + + ppi_setpin(fd, pgm->pinno[PIN_AVR_RESET], 0); + usleep(1); + /* * enable the 74367 buffer, if connected; this signal is active low */ - /*ppi_setpin(fd, pgm->pinno[PIN_AVR_BUFF], 0);*/ ppi_clr(fd, PPIDATA, pgm->pinno[PPI_AVR_BUFF]); /*