delay() function acting weird


so made sketch, purpose of flip pin 5 on , off @ regular intervals pwm capability of flipping extremely fast.. in 8 mhz fast.  however, time being switching frequency more modest 600 khz.  i'm using timer1 achieve this.

now, since i'm using timers, interrupts , direct port manipulation flip pin, loop function empty decided throw blink function in there see if work alright in parallel timer activity.  didn't.  led blinks 10x faster supposed to.  have delay(1000); call , light blinking fast.  had bump delay(10000) make blink @ 1 second intervals.  when erase program , upload blink program, timing normal know isn't permanent damage board.

what causing happen?  delay function somehow reliant on registers or timers i'm using?  throwing off delay function's internal clock speak?

one more thing. tried stopping interrupts , restarting them @ 1 second intervals pin flipping @ 600 khz 1 second intervals.  odd happening waveform when this.  period in interrupts enabled no longer looks same when wasn't starting , stopping interrupts.  odd behaviour.  ideas?

quote
so made sketch, ...
what sketch?

how use forum


Arduino Forum > Using Arduino > Programming Questions > delay() function acting weird


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code