AT Tiny85 Test Project Very Slow

Hi all,

Well I made a little test project to help me get the basics, The code pasted works fine on my Arduino uno.

I have changed the pins to work on a ATTiny85. But know the LED blink(delay) realy slow.

Did I do something wrong or is the the nature of the 85.

Thanks

// LED  Effect

int ledpin1 = 0;
int ledpin2 = 1;
int ledpin3 = 2;

void setup()
{
pinMode(ledpin1, OUTPUT);
pinMode(ledpin2, OUTPUT);
pinMode(ledpin3, OUTPUT);
}

void loop() {
digitalWrite(ledpin1, HIGH);
digitalWrite(ledpin2, HIGH); 
digitalWrite(ledpin3, HIGH);
delay(1000);
digitalWrite(ledpin1, LOW);
digitalWrite(ledpin2, LOW);
digitalWrite(ledpin3, LOW);
delay(1000);
digitalWrite(ledpin1, HIGH);
delay(500);
digitalWrite(ledpin1, LOW);
digitalWrite(ledpin2, HIGH);
delay(500);
digitalWrite(ledpin2, LOW);
digitalWrite(ledpin3, HIGH);
delay(500);
digitalWrite(ledpin3, LOW);
delay(1000);
}
  1. did you set the fuses correctly?
  2. what core did you use?

The chip comes with the divide-by-8 clock fuse bit set by default. How far apart are the flashes? 8 seconds?

Osgeld:

  1. did you set the fuses correctly?
  2. what core did you use?
  1. I believe I set it to 8Mhz internal clock. Is there anything I can do to see whats it set at?
  2. Not Sure what that means.

8sec on the money. So now do I divide 1000 by 8 ?

kculm:

Osgeld:

  1. did you set the fuses correctly?
  2. what core did you use?
  1. I believe I set it to 8Mhz internal clock. Is there anything I can do to see whats it set at?
  2. Not Sure what that means.

in order to use the 85 you had to download and install a core file, where did you get it?

arduino tiny works wonderfully, the one on a mit.edu site functions, but no one bothered to change any timing values so by default its 8 * slower(at 8 Mhz, or 16 times slower at 1Mhz) when using timer functions (and thats half assed IMO)

I got the files form http://hlt.media.mit.edu/?p=1695 ( a link on it)

I do however get errors when I do the boot loader part.

I have been asking for help on that on this forum.

Osgeld:
in order to use the 85 you had to download and install a core file, where did you get it?

I am sorry I don't know what assed IMO means

arduino tiny works wonderfully, the one on a mit.edu site functions, but no one bothered to change any timing values so by default its 8 * slower(at 8 Mhz, or 16 times slower at 1Mhz) when using timer functions (and thats half assed IMO)

For what you are doing, 1 Mz is fine. It uses less power.
Certainly, divide the time by 8!

Sounds like you are using the 8 MHz internal clock but also have the divide-by-8 fuse set.

If you don't particularly mind the slow speed, just divide the delays by 8. (eg. delay(125) would delay for one second).

kculm:
I got the files form http://hlt.media.mit.edu/?p=1695 ( a link on it)

well theres your problem

as I stated before that core does not compensate for timing differences

you have three choices, get arduino tiny

http://code.google.com/p/arduino-tiny/

and forget the other core even exists (god I wish it did, as I cant tell you how many times I have "solved" this problem)

get in the deep end and fix that core yourself (it shouldnt be that hard, but it should not be a screwup in the first place)

or take all your delays and devide them .. your current clock speed / 16 and change all your delays to delay ms

I dont really want to bash the mit student page, cause it saved my butt while arduino tiny got a bug fix, but sheesh they could at least check in and fix their obvious problem (in a nutshell they redo a couple files and compile against a standard arduino, 16 mhz core)

I know all this cause I spend two night banging my head against the desk trying to figure out what was wrong with MY code, and I know arduino tiny works cause I have been using it before it was released