Go Down

Topic: ATMega8-16pu too slow (Read 555 times) previous topic - next topic

hilti_ch

Hello,

I've put an Atmega8-16pu in the Arduino duemilanove board.
I use the USBtinyISP to burn sketches

This is my config of boards.txt

##############################################################

usbtiny8.name=ATmega8 avec USBtinyISP
usbtiny8.upload.using=usbtinyisp
usbtiny8.upload.maximum_size=7168
usbtiny8.upload.speed=38400
usbtiny8.build.mcu=atmega8
usbtiny8.build.f_cpu=16000000L
usbtiny8.build.core=arduino

When I burn, I can see the sketch work fine but very slow.
Exemple to make 1 loop of Blink @ 1000 high 1000 low take 3,02 seconds

I've check datasheets of Atmega8 vs Atmega328 and pinout are same...

What's my problem?
Thanks

Sorry for my english I'm swiss

tack

What bootloader are you using?
What are the fuse settings?
Post the sketch. I know you said it was just Blink, but still post it.

hilti_ch

Hi Tack and Tanks,

No bootloader
No Fuse

Sketch:

void setup() {                
 pinMode(13, OUTPUT);    
}

void loop() {
 digitalWrite(13, HIGH);  
 delay(1000);            
 digitalWrite(13, LOW);    
 delay(1000);            
}

I've trying this but result is same:

##############################################################

usbtiny8.name=ATmega8 avec USBtinyISP
usbtiny8.upload.using=usbtinyisp
usbtiny8.upload.maximum_size=7168
usbtiny8.upload.speed=38400
usbtiny8.upload.speed=115200
usbtiny8.bootloader.low_fuses=0xff
usbtiny8.bootloader.high_fuses=0xc8
usbtiny8.bootloader.unlock_bits=0x3F
usbtiny8.bootloader.lock_bits=0x0F
usbtiny8.build.mcu=atmega8
usbtiny8.build.f_cpu=16000000L
usbtiny8.build.core=arduino

hilti_ch

Re-Hello

I've changed:
Code: [Select]

usbtiny8.build.f_cpu=16000000L

by
Code: [Select]

usbtiny8.build.f_cpu=1600000L

and connected an Arduino Mega with this sketch:

Code: [Select]

long tmps;
int ok;

void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
}

void loop() {
  if (digitalRead(2) == 1)
  {
    if (ok == 1)
    {
      Serial.println(millis() - tmps);
      tmps = millis();
      ok = 0;
    }
 
  }
  else
  {
    ok = 1;
  }
}



The mega give me 2045 or 2046 ms
not bad but not awesome...

fungus

What are you timing? "Serial.println()"?

That's going to depend on the baud rate, not the speed of the CPU.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up