Calibrating ATtiny85

Hi everyone,

I have an ATtiny85 and want to calibrate its internal oscillator... I read a lot now and tried some stuff all day, but I am kind of lost. I stumbled across http://ernstc.dk/arduino/tinytuner.html and it sounded promising, but I think the instructions are skipping some steps? At least, I could not get TinyISP to compile.

Does anyone have a good step-by-step tutorial explaining how to calibrate an ATtiny85?

Thanks in advance!

KrawallKurt: At least, I could not get TinyISP to compile.

Error(s)?

Arduino IDE version?

I am using Arduino 1.8.7. The errors I get:

/tmp/ccpyryE8.s: Assembler messages:
/tmp/ccpyryE8.s:2119: Error: unknown opcode `delay_fine'
lto-wrapper: /home/user/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc returned 1 exit status
/home/user/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
exit status 1

EDIT: Just downgraded to 1.5.8. Now, TinyISP compiles and I could flash it to the Uno. What would be the next step? This is where I think the instructions are skipping some steps. It's like "configure some options and then there exists a tuning signal"...

KrawallKurt: I am using Arduino 1.8.7.

Odd. Built without error using 1.8.5.

Where did you get the source code?

http://ernstc.dk/arduino/tinytuner.html

The section of interest is TinyTuner2. _TinyISP_BuildOptions.h is a file that comes with TinyISP. Modify the three macros in that file as described on @Erni's website.

I used the code from https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/arduino-tiny/tiny-isp-2-0100-0001.zip

So, I read the section TinyTuner2, modified the macros and uploaded the TinyISP sketch to the Arduino Uno. What is the next step? Now I should upload an example sketch to the tiny85. How? Which one? Should I set the IDE Programmer to Arduino as ISP like when I am using the ArduinoISP sketch on the Uno? Or something else? Then, I cannot find a boardmanager in Arduino 1.5.8. How would I select the tiny85?

This is what I meant when I said the tutorial skips a few steps. I’m not an expert and these details are not obvious to me.

https://www.google.com/search?q=how+to+program+attiny85+with+arduino

Don't act helpless. Just because it doesn't say on that page how to load a program to an ATTINY 85 doesn't mean you can't find it.

If your simple google search would anser these questions, I wouldn't ask.

I know how I normally program a tiny: I upload ArduinoISP to my Uno and flash my sketch to the tiny by setting the Programmer in Arduino IDE to Arduino as ISP.

However, in this case, I neither know which sketch I should even upload to the tiny, nor how TinyISP behaves and what it expects me to do.

When you download the TinyTuner, there is an example folder containing 2 example schetches. Pick one to upload to the Tiny.

I will update the page to make it more clear

After trying multiple arduino versions until I found one that was able to compile everything, here is what I did:

In Arduino 1.5.8, I flashed TinyISP to my Uno. Then, I installed the Arduino Tiny for 1.5, set the board to Attiny85, Programmer to Arduino as ISP and flashed PrintUsingKnockBang to the tiny85.

Now, when I run the serial monitor, I get the following output:

--- Monitor starting ---

--- Target was reset and is now running ---

--- Knock-Bang fault: 11 ---

--- Knock-Bang fault: 15 ---

Is this the expected output? What does it mean?

KrawallKurt: Now, when I run the serial monitor, I get the following output:

https://github.com/Coding-Badly/TinyISP/blob/master/KnockBangReceiver.cpp#L296-L304

KrawallKurt: Is this the expected output?

Occasionally that may happen while the target is booting. Otherwise, no, that is not expected output.

KrawallKurt: What does it mean?

Wiring. Make certain the wiring is correct.

Timing. Make certain the target fuses / build options are correct.

By default the board running TinyISP is expected to be running at 16 MHz.