Bricked my ATTiny84?

I’ve been playing with an ATTiny84 for the past few weeks and yesterday decided to try TinyTuner.

I uploaded this sketch to the ATTiny84:

#include <SoftwareSerial.h>
#include <TinyTuner.h>

SoftwareSerial mySerial(3, 4);
byte count=0;

void setup()
{
  Tune();
  mySerial.begin(9600);
}

void loop()
{
  mySerial.print((char)count++);
  if(count>255){
    count=0;
  }
  delay(500);
}

void Tune( void )
{
  Tiny84Tuner tt;
  bool KeepGoing = true;

  while ( KeepGoing )
  {
    KeepGoing = tt.update();

    // Optionally provide feedback here
  }
  // At this point, OSCCAL is set to the optimal value
}

I then uploaded this sketch to my MegaADK:

void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
  
}

void loop()
{
  Serial1.write("x");
}

void serialEvent1(){
  while(Serial1.available()){
    Serial.println(Serial.read());
  }
}

Connected the Mega Serial1 Tx to pin 0 (PB0) on the ATTiny84 and then ATTiny84 pins 3 & 4 to Mega Serial Tx & Rx.

I was hoping TinyTuner would calibrate itself using the serial input from Serial1 on the Mega and then start to send my ‘count’ varible to Serial on the Mega.
I ran everything and the Mega Serial monitor showed nothing being received from the ATTiny84.

I decided not to experiment further and instead upload a sketch to my ATTiny84 that i had been working on - problem is now i can no longer upload any sketches to the ATTiny.
All attempts to upload result in the error message:

Device signature = 0x000102avrdude.exe: Expected signature for ATtiny84 is 1E 93 0C

I then read in the thread i linked to above that TinyTuner listens for the ‘x’ serial input on pin 1 NOT on pin 0 so i changed my jumper wire and tried again.
Still the ATTiny84 fails to output anything on it’s SoftwareSerial Tx and i cannot upload other sketches to it.

Has TinyTuner changed an internal register in it’s TimeNineBits method, failed to detect any ‘x’ serial input and left itself so that it can no longer be programmed?

I’m programming the ATTiny84 using this USBasp.

Martin.

I then uploaded this sketch to my MegaADK:

void loop()

{
  Serial1.write("x");
}

That won't work. There has to be a short delay (probably about 1/4 second) between 'x' characters. The code is intended to work with a human at the other end.

warwound:
Has TinyTuner changed an internal register in it’s TimeNineBits method, failed to detect any ‘x’ serial input and left itself so that it can no longer be programmed?

No. Serial programming is performed with RESET asserted which means the target is not running (TinyTuner won’t be running during programming).

Did you change the fuses on the target (the ATtiny84)? Typically fuses are changed by executing Tools / Burn Bootloader.

The ATTiny84 sketch i posted was just the first one that i tried, before posting i had tried adding a delay() after the Serial.write("x").
I tried delay(500) and delay(250) but the ATTiny84 SoftwareSerial still did not send any output to my Mega.

But as you say that the programming is performed with RESET asserted and the currently loaded sketch will not effect the uploading of a new sketch then the problem must be elsewhere.

I tried using the Arduino IDE and it's Burn Bootloader menu option, i tried that with both 1MHz and 8MHz internal clock.
(This is the only method i have used to modify the ATTiny84 clock speed).
This failed, sometimes with the same error as when uploading a sketch:

Device signature = 0x000102avrdude.exe: Expected signature for ATtiny84 is 1E 93 0C

Sometimes the device signature reported was different from 0x000102, i didn't make a note of this other signature though.
I could try buring the bootloader again to find this other reported signature but wonder if the problem is elsewhere...

I connected the Mega Serial and Serial1 ports directly to the pins on the ATTiny84.
The Mega and USBasp are both connected to my computer via the same USB hub (this setup has worked with no problems in the past).

I've seen an example where a 220ohm resistor has been placed between an arduino board serial port and an ATTiny pin.
Is this essential - have i bricked the ATTiny84 by directly connecting it to the Mega with no resistor?

Thanks.

Martin.

Is this essential - have i bricked the ATTiny84 by directly connecting it to the Mega with no resistor?

Not essentially but a good idea. It protects both sides in case you have a wiring problem. (For what it's worth, I always recommend including the resistors but never do it myself.)

warwound:
I tried using the Arduino IDE and it's Burn Bootloader menu option, i tried that with both 1MHz and 8MHz internal clock.
(This is the only method i have used to modify the ATTiny84 clock speed).
This failed, sometimes with the same error as when uploading a sketch:

Were I in your shoes, I would get uploading to work consistently before trying to get Tiny Tuner working. You should be able to upload error-free every single time you upload.

Given the fact that you are using a dedicated programmer, the most likely culprit is wiring (e.g. loose wire, loose connection, defective wire).

It probably won't help with the problem you are having but be sure to include a 0.1 uF capacitor across VCC and GND as close as possible to the target (the ATtiny84). A 10 K? pull-up resistor on the target's RESET pin is also a good idea.

You can't brick a chip by running a sketch.

You can destroy I/O pins by connecting them to other things without connecting the grounds together.

Given the fact that you are using a dedicated programmer, the most likely culprit is wiring (e.g. loose wire, loose connection, defective wire).

Well i have the USBasp connected to my ATTiny84 on a breadboard using some male to female jumper leads.
I removed the leads and connected them again - still no luck uploading a sketch.

Next i used my diecimila clone as an ISP (using a different set of jumper leads).

First Burn Boatloader @ 1Mhz succeeded.
Then i uploaded Blink and my ATTiny84 is now happily flashing away!

I bet the jumper leads i'm using with the USBasp are the culprits - i'll check them out another day, for now i can get on with the ATTiny84 programming using ArduinoISP.

Thanks for all the advice.

Martin.

warwound:
Thanks for all the advice.

You are welcome. Thank you for the follow-up.