My system - ATMega168pa, 16MHz, Arduino IDE 1.8.10, WIN 7 32 Bit
I have a (small) programme which toggles 3 leds (1 sek each) and sends data via USART (every 70ms). To compile it I use the Arduino IDE 1.8.10 (could use my AVRStudio4.18 too, of course). In my programme I use TIMER2_OV_vect and self defined USART routines - see attached Klaus_03.c (with the "int main()" routine and Klaus_02.c only the "void setup" and "void loop" routine.
Now there's the problem:
When that programme is written with an "int main()" - loop (like it'd be written for compilation with my AVRStudio4 and NOT for compilation within that Arduino IDE) and I compile it within the Arduino IDE then all is ok - the leds are toggling with 1 sek and the data are transmitted every 70 ms as defined.
When that programme is written with "void setup()" and "void loop()" instead of "int main()" (=> Arduino style) and it's compiled then within that Arduino IDE the leds toggle with a time delay of 3 (!) seks and the data are transmitted every 218ms - so it looks like there'd be either a modifcation of the Timer or the frequency or whatever.
And for the life of me - I can't see where that error might be.
The fuses are set EXT 0xF9, HIGH 0xDD, LOW 0xFF, LOCK 0xFF.
Your kind advice / help would be much apreciated as I'm completely clueless
Question - could it be problem caused by TIMER2?
Thanks in advance