Skip to content

Commit

Permalink
add busywait for fuse program
Browse files Browse the repository at this point in the history
Attiny85 has tWD_FUSE rated for 4.5ms. Without delay, the fuse program may fail. busyWait does work for fuse program. Verified on logic analyzer.
  • Loading branch information
DeqingSun committed Apr 12, 2021
1 parent 988d8ea commit 5de3056
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Adafruit_AVRProg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ bool Adafruit_AVRProg::programFuses(const byte *fuses) {
return false;
}
}
busyWait();
f = pgm_read_byte(&fuses[FUSE_LOW]);
if (f) {
Serial.print(F("\tSet Low Fuse to: "));
Expand All @@ -202,6 +203,7 @@ bool Adafruit_AVRProg::programFuses(const byte *fuses) {
return false;
}
}
busyWait();
f = pgm_read_byte(&fuses[FUSE_HIGH]);
if (f) {
Serial.print(F("\tSet High Fuse to: "));
Expand All @@ -210,6 +212,7 @@ bool Adafruit_AVRProg::programFuses(const byte *fuses) {
return false;
}
}
busyWait();
f = pgm_read_byte(&fuses[FUSE_EXT]);
if (f) {
Serial.print(F("\tSet Ext Fuse to: "));
Expand All @@ -218,6 +221,7 @@ bool Adafruit_AVRProg::programFuses(const byte *fuses) {
return false;
}
}
busyWait();
Serial.println();
endProgramMode();
return true;
Expand Down

0 comments on commit 5de3056

Please sign in to comment.