# calibrate attiny85

Hi,

Searched my ass off to find a good instructable to calibrate my attiny45/85

Does anybody know where to find such a 'n00b' proof example/steps/instructable?

(I want my attiny to run 24hours and only be off by some minutes....now it's off after 10sec already

Hope someone can get me going again, thx!!

http://forum.arduino.cc/index.php?topic=173408.0

http://www.ernstc.dk/arduino/tinycom.html

The guarantee from Atmel is 1% which comes out to 14 minutes over one day. I typically get an order of magnitude better.

Thank you!! Will get me going in the right direction

I typically get an order of magnitude better.

What's your experience with an attiny85 and it's precision looking at 24hours ?
Off only by seconds?

String numeric output with V-USB HID - Exhibition / Gallery - Arduino Forum

YES...

IF the temperature is constant!

But RC oscillator stability varies with temperature. Hince, god gave man the crystal that varies far less with temperature- though, it ain't perfect. For that, the devil created the crystal oven.

Ray

Over the entire envelope (-40Â° to 85Â°; 2.8V to 5.5V) you can expect an error of as much as 78.3 minutes over one day (~4696 seconds over 86400 seconds).

At 25Â° the graph has a sweet spot between 2V and 3.5V where the frequency is almost flat.

Calibrated 8 MHz RC Oscillator Frequency vs. VCC in the datasheet will help you decide if you can get the error to an acceptable level.

Oke, begin to understand some more ;)I'm not a microchip technicus

I have my arduino nano 3.0 hooked up and got tinyISP uploaded.
Also use a resister between rst and 5v and uploaded a sketh

``````#define KNOCK_BANG 1
#include <TinyDebugKnockBang.h>

#ifdef KNOCK_BANG
#define Serial Debug
#endif
int a;
void setup() {
Â Serial.begin( 9600 );
Â  Â  Â a = 1;
}

void loop() {
Â delay(1000);
Â Serial.println("hello world"); // debug output
Â Serial.println(a); // debug output
Â a++;
}
``````

The serial output gets started by ! but I believe it's not getting uploaded through the arduino into the tiny?!

What could I be doing wrong here?

*EDIT
Now I also get "avrdude: stk500_getsync(): not in sync: resp=0x15" , which I don't really understand if I read your above link.

*EDIT AGAIN
Restarting arduino IDE solved this error and now it gets uploaded to the attiny. Jet another step further But now I only get alot )-:

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

--- Knock-Bang fault: 4 ---

*EDIT AGAIN:

knock-bang has something to do with "Debug.begin( 250000 );" ?

Used this example and now it worked:

``````#include <TinyDebugKnockBang.h>

void setup( void )
{
Debug.begin( 250000 );
}

void loop( void )
{
Debug.println("Test knock-bang");
delay( 1000 );
}
``````
``````--- Monitor starting ---
Test knock-bang
Test knock-bang
Test knock-bang
Test knock-bang
Test knock-bang
``````

NEXT THING: using tiny tune to get it calibrated....mhhz

Tinytuner PrintUsingKnockBang is getting upload alright, but nothing is shown in the monitor ?
Any suggestions ? (or maybe a small explanation how it's calibrating and against what, the serial baudraite?)

creamers:
Tinytuner PrintUsingKnockBang is getting upload alright, but nothing is shown in the monitor ?
Any suggestions ? (or maybe a small explanation how it's calibrating and against what, the serial baudraite?)

Instructions:
http://www.ernstc.dk/arduino/tinycom.html

In the TinyISP sketch navigate to _TinyISP_BuildOption.h and copy this line

#define RELAY_KNOCK_BANG_ENABLED 1

Here is how it should look
To use it open the serial monitor

â€¢ Ensure 19200 baud is selected
â€¢ Enter a single exclamation mark (!) and click Send
â€¢ The following line is output by the Arduino...
--- Monitor starting ---
â€¢ Enter a single exclamation mark (!) and click Send
â€¢ The following line is output by the Arduino...
--- Monitor stopped ---
Other commands to use:

@ Toggle between holding the target in reset after programming and allowing the target to run immediately

# Reset the target now or allow the target to run if it is held in reset

\$ Hold the target in reset

Regarding TinyTuner:

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

Thank you guys!! Gonna try it as soon as I'm @ home.

Think this is the only thing I didn't fetch Now just need to do this for a attiny85 (or 45)

"The tuning signal comes from pin 3 on the UNO so you need to connect a jumper wire from pin 3 on the UNO to XTAL2 pin on the target."

pin 3 on the UNO is an external interrupt pin.

This OC2B pin on the NANO v3 => D3

XTAL2 on an attiny85 is pb4 pin 3.

Hope it's correct, also for other n00bs like me who are curious and exploring with the helpl of you guys!

YES, finally ... got it.

OSCCAL = 0x53;

Thx for helping. I posted what I did, so it probably helps others to.

Thanks for the help, now I'll see how precise it will run over 24hours.

Hi guys, i'm a noob that try to calibrate his attiny85.. i'm following this method: http://nathan.chantrell.net/20121014/tinypcremote-an-attiny85-based-infrared-pc-remote-control/ but, when i try to upload to attiny the "interactive to serial with details" sketch, i get a lot of errors about declarations and wrong classes.. someone can help me please?

ok all done thanks!

If satan created the oven, who created the rubidium oscillator?