Problems with delay()

Hi everybody, I'm new at this world of arduino, but not so much with the programming one. The thing is that I'm running some tests on the arduino IDE and checking out the examples. When I try to program some scketch with the delay() function or try out the examples (like blink) it stops at the delay function, not the compiler but the board. I'm running all the tests in the proteus simulation program. It runs perfectly untill the delay.
What is happening?

Help please!!!

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

What is happening?

Sounds like the simulator, not the Arduino, is failing. It does NOT sound like an Arduino problem.

I've always used the simulator with other uCs incuding PICS and 0 problems. Besides the sim only uses the .hex file the arduino IDE generates

Does the simulator support timer interrupts? An easy way to check is to see if millis() is changing. If it's not, delay won't work either.

If you really want help, you're going to need to tell us which simulator you have.

I have the proteus simulator (ISIS). It has the minimal circuitery (crystal, reset bttn, etc) and one simple led. It blinks but aparently it keeps 16 secs on and then 16 off. I didn't realized before because I was just expecting a 1hz blink. What culd be happening?

The arduino runs at 16MHz, but the default for an atmega328p is 1MHz. That's 16 times slower. Did you set the crystal correctly?

I think you're right. I've been checking out the source of the clock and I think there's the error. Do you know which of the diferent clock sources is the arduino's one? And if you know exactly the register configuration you will save me completely!!

The registers are set with the code. Do you mean fuses?

The millis timer is timer0.

Check out {arduinodir}/hardware/arduino/cores/arduino/wiring.c and scroll down to the init function for how the registers are set up.

It seems like I've managed to solved it. The clock source was wrong and the 8 divider of the clock was enabled somehow.

Thanks to you all!!