If I have understood the datasheet and previous posts here the microcontroller can't read OSCCAL during a debug session. (ATmega32, JTAG with mkII). I presume that the register can't be written to either?
In my case there is a calibration routine that use a 32kHz crystal on TIMER 2 in the beginning of the program. So this calibration routine should work just fine during normal mode but will fail during debugging.
So how should I make this work? If OSCCAL can not be written to I can not change the clock speed meaning my program can't communicate (7.2 MHz) during debug. To at least check that the calibration routine works I have thought about storing the calibrating byte in EEPROM just to check the value.
I hope there is something that I have misunderstood though. Can someone clarify this for me?