[SOLVED] ATtiny85 Package Variation Serial Issues

Hi there! I have written the following sketch for use with an ATtiny85:

#include <SendOnlySoftwareSerial.h>

const int serialPin = 1;
const int baudRate = 2400;
SendOnlySoftwareSerial SendOnlySerial(serialPin);

void setup() {
  SendOnlySerial.begin(baudRate);
}

void loop() {
  SendOnlySerial.print(analogRead(A1));
  SendOnlySerial.print("\n");
}

The sketch takes a reading from one of the analog pins, and uses (a slightly modified version of) the SoftwareSerial lib to transmit that value over a wire.

My problem is that some package variations of the ATtiny85 output this serial signal just fine, while others do not.

The serial signal is correctly produced by this variation of the IC:
ATtiny85-20PU (purchase link)
Output from the serial monitor

The serial signal is incorrectly produced by this variation of the IC:
ATtiny85-20SU (purchase link)
Output from the serial monitor

I have tested several of both types of IC using the same sketch and the same serial monitor setup.


According to section 25.3 of the datasheet, the only difference between these chips is their package type.

Any help or suggestions with this would be greatly appreciated. Thank you!

Additional info:

  • running Arduino IDE v1.8.7
  • using the internal 8MHz crystal for the chip clocks

What difference do you see?

Have you correctly set fuses and confirmed that the chip is indeed running at 8MHz like you think it is?

The 8MHz on-chip oscillator (NOT a crystal!) is not very accurate - it's only guaranteed to be +/- 10% without user calibration (and the exact frequency will vary between individual pots). I've never encountered an attiny85 that wasn't close enough for serial to work on 3.3~5v at room temperature, but such a unit would be entirely within Atmel's specs.

Have you correctly set fuses and confirmed that the chip is indeed running at 8MHz like you think it is?

That was it! I mistakenly figured they were all pre-set to 8MHz when shipped from the manufacturer. Makes sense now why the upload was successful but the serial wasn't working. Thank you very much for your quick response and helpful advice!