Programming multiple ATTiny25s sequentially

Discussion in 'Embedded Systems and Microcontrollers' started by Twerpling, Jun 1, 2009.

  1. Twerpling

    Thread Starter New Member

    Apr 1, 2009
    Here is my set up: I have a large series of control boards that are connected to each other through an I2C bus. Each board sends out a PWM signal (to control a motor on an ESC) and has a sensor signal line that goes to a sensor board. The series of control boards are connected to a master board which is connected to a PC. The PC directs the master board to send signals to specific control boards thereby controlling specific motors along this chain to get some kind of motor control action going.

    For experimentation purposes I need to be able to reprogram the control boards in this entire series since I want to test a large ammount of control methods all of which require some kind of tweaking to specific coeffients. The problem I am encountering is that I am having difficulty coming up with a method to sequentially reprogram each board without me having to physically connect and reprogram each board manually.

    My first idea is to add on two address lines on to the board and adding some simple logic to "address" each board individually. This would use up no uC lines and would make the addressing of each board done in discrete hardware. Since I am using the AVRISPMKII I would have the boards hardwired to each individual address and if the address would set the reset pin to program. I figure each additional board would ignore the programming signals sent by the master and simply not do anything.

    A second idea is to modify the bootloader to use the I2C bus to rewite the firmware through purely programmatic methods. That is the bootloader would just over write certain sections to alter the programming of the uC.

    Any other ideas on how to do this? Any ideas which one of these methods would be easier?
  2. John Luciani

    AAC Fanatic!

    Apr 3, 2007
    Either idea should work.

    Modification of the bootloader to accept a broadcast download seems like
    it could be easier.I have used this type of bootloader in a system. Also,
    the bootloader was written so it could update itself.

    Another idea is to flash all the chips with a single ISP port. You tie all the ISP
    inputs on the target boards together (with current limiting resistors) and
    to the header. You then tie the ISP output pins from a single board to the ISP
    header. Since all of the boards are identical and synchronized they all flash
    the same way. The downside is there is no verification of each board.

    (* jcl *)