lok
Junior Member level 3
hi all,
I am working with atmega256rfr2 and I stuck with some portion of the program which is like asynchronous operation of the chip....I have connected 32.768 crystal between tosc1 and tosc2 pin but its not works for me ..please give your suggestion to get out from this problem ...
this is the program that I am stuck with
the pro gram is not exit from this while loop
what would be the problem ?? is it the register initialization proplem ? or the crystal oscillator problem??
Regards,
lok
I am working with atmega256rfr2 and I stuck with some portion of the program which is like asynchronous operation of the chip....I have connected 32.768 crystal between tosc1 and tosc2 pin but its not works for me ..please give your suggestion to get out from this problem ...
this is the program that I am stuck with
Code:
#define HAL_ASSR_FLAGS ((1 << TCN2UB) | (1 << OCR2AUB) | (1 << OCR2BUB) | (1 << TCR2AUB) | (1 << TCR2BUB))
TIMSK2 &= (~(1 << OCIE2A) & ~(1 << TOIE2));
ASSR|=(1<<AS2);
TCNT2=0;
TCCR2A=0x00;
TCCR2B=0x00;
OCR2A=0x00;
while(ASSR&HAL_ASSR_FLAGS );
the pro gram is not exit from this while loop
what would be the problem ?? is it the register initialization proplem ? or the crystal oscillator problem??
Regards,
lok