Multiple Boards to Program - Best Approach?

Hi Guys

I'm using USBASP to upload a small sketch to an ATtiny841 on a standalone board. The sketch uploads properly and quickly, so no problem there. However I need to program up to 20 identical boards with the same sketch. I can't just upload the sketch then remove the programming probes (I am using 6 pogo pins onto programming pads on the pcb) and then transfer them to the next board and repeat the upload process as I get this error message when trying to upload on any subsequent board:

avrdude: Version 6.0.1, compiled on Apr  3 2014 at 23:12:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         AVR Part                      : ATtiny841
         Chip Erase delay              : 4500 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   16    512  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: error: programm enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Doing the same operation using a UNO as ISP but using a standard ICSP 6way connector produces the same result, and I have to disconnect the USB connection to the pc each time otherwise I get the same sort of error. However, with the USBASP, its more awkward as its plugged into my pc directly and I don't want to wear out the USB connector or risk damaging the programmer by handling it all the time. Simply removing the programmer onboard power jumper (3.3/5v choice) to remove power from the USBASP during swapping the boards doesn't help, I still get the error message and have to go through removing the programmer from the usb connection and reconnecting and reconfirming the COM port all over again.

Is there a more elegant way around this? If I buy a USB extension cable (which will be a good idea anyway) I could add a switch into it, but which of the lines would have to be switched? D+, D- or ID? I've already established that removing just 5v has no effect? Any suggestions gratefully received!

Bernie

Nick Gammon, I seem to remember, has an ISP version of a sketch to do this... may be incorrect however. I saw an Adafruit video once of a free-standing ISP programmer she built from a UNO. Anyway,

I do it via ISP from a Windows script, will lend itself to Pogo ISP: Windows Batch ISP using AVRDUDE

Ray

Thanks for that Mrburnette. It might be something I could try but I don't have any level of competence with AVRDUDE or DOS! I just consider myself very lucky when I get an AVR chip programmed :)

I was hoping there was a simpler method, so I think I'll probably just get myself a USB extension lead and maybe experiment with making/breaking different lines with a switch until something works (or I short something), or more likely simply persevere with the disconnection/reconnection of the USB connector at the pc for each board. If keep the batches to 20 or more each time I may complete them without breaking something!!

Thanks anyway Bernie

You could look into Nick Gammon's program from SD card and my standalone programmer hardware that runs the code. May have to ask Nick about an update if your chip type is not listed here:

// see Atmega datasheets
const signatureType signatures [] PROGMEM = 
  {
//     signature        description   flash size   bootloader  flash  fuse
//                                                     size    page    to
//                                                             size   change

  // Attiny84 family
  { { 0x1E, 0x91, 0x0B }, "ATtiny24",   2 * kb,           0,   32,   NO_FUSE },
  { { 0x1E, 0x92, 0x07 }, "ATtiny44",   4 * kb,           0,   64,   NO_FUSE },
  { { 0x1E, 0x93, 0x0C }, "ATtiny84",   8 * kb,           0,   64,   NO_FUSE },

  // Attiny85 family
  { { 0x1E, 0x91, 0x08 }, "ATtiny25",   2 * kb,           0,   32,   NO_FUSE },
  { { 0x1E, 0x92, 0x06 }, "ATtiny45",   4 * kb,           0,   64,   NO_FUSE },
  { { 0x1E, 0x93, 0x0B }, "ATtiny85",   8 * kb,           0,   64,   NO_FUSE },

  // Atmega328 family
  { { 0x1E, 0x92, 0x0A }, "ATmega48PA",   4 * kb,         0,    64,  NO_FUSE },
  { { 0x1E, 0x93, 0x0F }, "ATmega88PA",   8 * kb,       256,   128,  extFuse },
  { { 0x1E, 0x94, 0x0B }, "ATmega168PA", 16 * kb,       256,   128,  extFuse },
  { { 0x1E, 0x95, 0x0F }, "ATmega328P",  32 * kb,       512,   128,  highFuse },

  // Atmega644 family
  { { 0x1E, 0x94, 0x0A }, "ATmega164P",   16 * kb,      256,   128,  highFuse },
  { { 0x1E, 0x95, 0x08 }, "ATmega324P",   32 * kb,      512,   128,  highFuse },
  { { 0x1E, 0x96, 0x0A }, "ATmega644P",   64 * kb,   1 * kb,   256,  highFuse },

  // Atmega2560 family
  { { 0x1E, 0x96, 0x08 }, "ATmega640",    64 * kb,   1 * kb,   256,  highFuse },
  { { 0x1E, 0x97, 0x03 }, "ATmega1280",  128 * kb,   1 * kb,   256,  highFuse },
  { { 0x1E, 0x97, 0x04 }, "ATmega1281",  128 * kb,   1 * kb,   256,  highFuse },
  { { 0x1E, 0x98, 0x01 }, "ATmega2560",  256 * kb,   1 * kb,   256,  highFuse },
      
  { { 0x1E, 0x98, 0x02 }, "ATmega2561",  256 * kb,   1 * kb,   256,  highFuse },
  
  // AT90USB family
  { { 0x1E, 0x93, 0x82 }, "At90USB82",    8 * kb,       512,   128,  highFuse },
  { { 0x1E, 0x94, 0x82 }, "At90USB162",  16 * kb,       512,   128,  highFuse },

  // Atmega32U2 family
  { { 0x1E, 0x93, 0x89 }, "ATmega8U2",    8 * kb,       512,   128,  highFuse  },
  { { 0x1E, 0x94, 0x89 }, "ATmega16U2",  16 * kb,       512,   128,  highFuse  },
  { { 0x1E, 0x95, 0x8A }, "ATmega32U2",  32 * kb,       512,   128,  highFuse  },

  // Atmega32U4 family -  (datasheet is wrong about flash page size being 128 words)
  { { 0x1E, 0x94, 0x88 }, "ATmega16U4",  16 * kb,       512,   128,  highFuse },
  { { 0x1E, 0x95, 0x87 }, "ATmega32U4",  32 * kb,       512,   128,  highFuse },

  // ATmega1284P family
  { { 0x1E, 0x97, 0x05 }, "ATmega1284P", 128 * kb,   1 * kb,   256,  highFuse  },
  
  // ATtiny4313 family
  { { 0x1E, 0x91, 0x0A }, "ATtiny2313A",   2 * kb,        0,    32,  NO_FUSE  },
  { { 0x1E, 0x92, 0x0D }, "ATtiny4313",    4 * kb,        0,    64,  NO_FUSE  },

  // ATtiny13 family
  { { 0x1E, 0x90, 0x07 }, "ATtiny13A",     1 * kb,        0,    32,  NO_FUSE },
 
   // Atmega8A family
  { { 0x1E, 0x93, 0x07 }, "ATmega8A",      8 * kb,      256,    64,  highFuse, true },

  // ATmega64rfr2 family
  { { 0x1E, 0xA6, 0x02 }, "ATmega64rfr2",  256 * kb, 1 * kb,   256, highFuse },
  { { 0x1E, 0xA7, 0x02 }, "ATmega128rfr2", 256 * kb, 1 * kb,   256, highFuse },
  { { 0x1E, 0xA8, 0x02 }, "ATmega256rfr2", 256 * kb, 1 * kb,   256, highFuse },

  };  // end of signatures

http://www.crossroadsfencing.com/BobuinoRev17/ |500x315

Hey Bob, is it my eyes or are we squished? :relaxed:

Your eyes, or maybe the camera was angled a little. The uC package looks square for instance.

I don't see anything square, maybe it's my iPad.

|500x318

.

Looks ok on my pc, but yes it is squished on mobile devices ???

Hi, I just stumbled across this thread but was wondering what the 0x0 type of code is succh as in the example below. I have no idea what it is and would really like to know.

 { { 0x1E, 0xA6, 0x02 },

See;
https://www.arduino.cc/en/Reference/IntegerConstants

few realize it is possible to program many avr chips at the same time in parallel. also contrary to popular belief only 3 signals needed. ive set up several customers to do this with one flashing 25 chips at a time. he was dong couple thousand a day so speed and efficiency paramount. hint: lif not zif and avrdude not the best tool.

Hi john1993 - that would be good if I was flashing loose chips, but mine will be surface mounted and be assembled in place (about 100 off pcbs). I need to flash around 20 of them at a time. After that I will modify the sketch if required (different customer different requirements) and load up the next batch of around 20 with the modified sketch. For that reason the chips can't be preprogrammed "en-mass". Thats my reason for using simply a USBASP and pogo pins (that and I've already designed pogo pin pads onto the pcb!!).

Thanks for the suggestion though. I think I'll still try the switch in the USB lead approach and see what transpires. If it works, it'll be the simplest solution - I'll let you know what happens :cold_sweat:

Bernie