Pages: [1]   Go Down
Author Topic: OptiloaderBoard  (Read 551 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it just happened that i have blown up some ATMega328s on a Breadboard due to too high Voltage on the Input. Shame on me!
Looking over the mess, i recognized that one of the ATMega was still sort of working, but i have  destroyed digitalPin 0 (RX)...

Well, i have needed some new 328 with Bootloader, so i decided to build a Board around the "non-RX-Pin-328", dedicated to "burn" the Optiloader Bootloader to factory-new ATMega328s. Not that i would need it every day (hopefully  smiley-wink), but just for fun. It is based on the OptiLoader sketch which can be found here: https://github.com/WestfW/OptiLoader

the PCB has the dimensoins of an Arduino-PCB, but ist neither a Arduino-Clone nor a Shield.
It supports 5V Power Supply via USB-B or a USB2SERIAL compatible FTDI-Style 6pin header, which also allows Serial communication for monitoring.
If you solder in C1, the autoReset functionality for the 6pin header is enabled, which would even allow to upload a sketch to the Master ATMega via USB2SERIAL.
To support feedback during the progress without Serial Communication, i have added a Power-ON statusLED for the Master ant the Target, a ERROR-LED and one for each function called in the loop() of the OptiLoadersketch.
I have soldered a basic 28pin socket for the Target ATMega on my PCB, but there shoud be enough space to use a 28pin ZIF Socket smiley-wink.

If anyone is interested, i have attached the Eagle files. Feel free to use it, reproduce it or modify it, but it would be great if you leave some feedback smiley-wink

The Optiloader sketch needs to be a little bit modified inside the setup() and loop() in order to control the LEDs to something like the following:
Code:
void setup () {
  Serial.begin(19200); /* Initialize serial for status msgs */
  pinMode(13, OUTPUT); /* Blink the pin13 LED a few times */
  pulse(13,20);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);
}

void loop (void) {
  boolean error = false;
  fp("\nOptiLoader Bootstrap programmer.\n2011 by Bill Westfield (WestfW)\n\n");
  if (target_poweron()) { /* Turn on target power */
    do {
     if (!target_identify()){ /* Figure out what kind of CPU */
       error = true;
       break;
     } else digitalWrite(A5, HIGH);
     if (!target_findimage()){ /* look for an image */
       error = true;
       break;
     } else digitalWrite(A4, HIGH);
     if (!target_progfuses()){ /* get fuses ready to program */
       error = true;
       break;
     } else digitalWrite(A3, HIGH);
     if (!target_program()){ /* Program the image */
       error = true;
       break;
     } else digitalWrite(A2, HIGH);
      (void) target_normfuses(); /* reset fuses to normal mode */
      digitalWrite(A1, HIGH);
   }
   while (0);
  }
  else {
   error = true;
   Serial.println();
  }
 target_poweroff(); /* turn power off */

  digitalWrite(A0, error);
  
  fp ("\nType 'G' or hit RESET for next chip\n")
    while (1) {
      if (Serial.read() == 'G'){
        digitalWrite(A5, LOW);
        digitalWrite(A4, LOW);
        digitalWrite(A3, LOW);
        digitalWrite(A2, LOW);
        digitalWrite(A1, LOW);
        digitalWrite(A0, LOW);
        break;
      }
    }
}

i know, the Hardware could be optimized. A polyfuse to protect the USB port would be nice. I think it would be not that bad to power the target 328 throug a transistor istead of the Master digital Pin 9, and the next time i would etch the PCB with bigger Pads for the Resistors , LEDs and Capacitors...  smiley-roll-blue
but after all... it is working!  smiley-cool


* OptiloaderBoard USB.jpg (148.81 KB, 816x612 - viewed 26 times.)

* OptiloaderBoard USB2Serial.jpg (164.66 KB, 816x612 - viewed 18 times.)
* OptiloaderBoard 001.zip (54.03 KB - downloaded 6 times.)
« Last Edit: January 07, 2013, 04:32:39 pm by garnienicht » Logged

Pages: [1]   Go Up
Jump to: