Yes but I commented all others as well. I just quoted the lines that caused the interrupt to stop working.
I want to disable the primary oscillator, because I have 2 operating modes:
1) USB attached, clocked from a 12Mhz ceramic resonator, with PLL enabled and CPU clocked at 48Mhz
2) USB detached, standalone, CPU and peripherial clocked from Timer1 secondary oscillator.
When the CPU wakes from sleep it should resume on the oscillator defined by the SCS bits, here SEC_RUN mode:
Code:
OSCCON.1 = 0
OSCCON.0 = 1 'Use Timer1 oscillator as clock source
Now you found that statement back from the datasheet, there's hope to make it work! I'll investigate harder and make some tests on a simplified program.
Bookmarks