patchAVR Downloader/UploaDEr - Patches: patch #5096, Allow VCC and BUFF to be any pin...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5096: Allow VCC and BUFF to be any pin in parallel mode

Submitter:  None
Submitted:  Mon 15 May 2006 02:35:30 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  joerg_wunsch Originator Email:  -email is unavailable-
Open/Closed:  Closed

Tue 29 Aug 2006 09:40:49 PM UTC, comment #1: 

Patch applied with some minor cosmetic changes.

It's been a bit of a challenge to extract the patch from the
HTTP datastream.  Attaching a separate file would have been
much preferrable.

Too bad you didn't leave your name, so no idea whom to attribute
this patch to.

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 15 May 2006 02:35:30 PM UTC, original submission:  

Currently only data pins can be used as VCC and BUFF, but some programmers (for example, Altera ByteBlaster) use control pins.

This patch allows to use any pins as VCC or BUFF:

diff -u -r1.44 config_gram.y
--- config_gram.y 27 Feb 2006 17:18:42 -0000 1.44
+++ config_gram.y 15 May 2006 13:57:14 -0000
@@ -389,15 +389,7 @@
       while (lsize(number_list)) {
         t = lrmv_n(number_list, 1);
         pin = t->value.number;
-        if ((pin < 2) || (pin > 9)) {
-          fprintf(stderr,
-                  "%s: error at line %d of %s: VCC must be one or more "
-                  "pins from the range 2-9\n",
-                  progname, lineno, infile);
-          exit(1);
-        }
-
-        current_prog->pinno[PPI_AVR_VCC] |= (1 << (pin-2));
+        current_prog->pinno[PPI_AVR_VCC] |= (1 << pin);
 
         free_token(t);
       }
@@ -414,15 +406,7 @@
       while (lsize(number_list)) {
         t = lrmv_n(number_list, 1);
         pin = t->value.number;
-        if ((pin < 2) || (pin > 9)) {
-          fprintf(stderr,
-                  "%s: error at line %d of %s: BUFF must be one or more "
-                  "pins from the range 2-9\n",
-                  progname, lineno, infile);
-          exit(1);
-        }
-
-        current_prog->pinno[PPI_AVR_BUFF] |= (1 << (pin-2));
+        current_prog->pinno[PPI_AVR_BUFF] |= (1 << pin);
 
         free_token(t);
       }
diff -u -r1.15 par.c
--- par.c 13 Apr 2006 20:10:55 -0000 1.15
+++ par.c 15 May 2006 14:12:40 -0000
@@ -109,6 +109,12 @@
   return 0;
 }
 
+static void par_setmany(PROGRAMMER * pgm, unsigned int pinset, int value) {
+  int pin;
+  for(pin=1; pin<=17; ++pin) {
+      if(pinset & (1<<pin)) par_setpin(pgm, pin, value);
+  }
+}
 
 static int par_getpin(PROGRAMMER * pgm, int pin)
 {
@@ -217,7 +223,7 @@
  */
 static void par_powerup(PROGRAMMER * pgm)
 {
-  ppi_set(pgm->fd, PPIDATA, pgm->pinno[PPI_AVR_VCC]);    /* power up */
+  par_setmany(pgm, pgm->pinno[PPI_AVR_VCC], 1);
   usleep(100000);
 }
 
@@ -227,12 +233,12 @@
  */
 static void par_powerdown(PROGRAMMER * pgm)
 {
-  ppi_clr(pgm->fd, PPIDATA, pgm->pinno[PPI_AVR_VCC]);    /* power down */
+  par_setmany(pgm, pgm->pinno[PPI_AVR_VCC], 0);    /* power down */
 }
 
 static void par_disable(PROGRAMMER * pgm)
 {
-  ppi_set(pgm->fd, PPIDATA, pgm->pinno[PPI_AVR_BUFF]);
+  par_setmany(pgm, pgm->pinno[PPI_AVR_BUFF], 1);    /* power down */
 }
 
 static void par_enable(PROGRAMMER * pgm)
@@ -254,7 +260,7 @@
   /*
    * enable the 74367 buffer, if connected; this signal is active low
    */
-  ppi_clr(pgm->fd, PPIDATA, pgm->pinno[PPI_AVR_BUFF]);
+  par_setmany(pgm, pgm->pinno[PPI_AVR_BUFF], 0);
 }
 
 static int par_open(PROGRAMMER pgm, char port)

The entry in avrdude.conf for ByteBlaster will look like this:

programmer
  id    = "blaster";
  desc  = "Altera ByteBlaster";
  type  = par;
  sck   = 2;
  miso  = 11;
  reset = 3;
  mosi  = 8;
  buff  = 14;
;

WARNING! This solution is quick&dirty and demands sizeof(int)>=4.
For portability struct PROGRAMMER should be modified.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-08-29 joerg_wunsch StatusNone Done
    Assigned toNone joerg_wunsch
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code