I am using embOS for the Microchip PIC18LF46K22 (embOS_PIC18_MPLAB_C18_Src_V382o1). The IDE is MPLAB-X v1.51. The compiler is C18 v3.38. The hardware is custom design. In my application I need to change the PIC's system clock source from the internal oscillator to an external TCXO on the fly to perform some functions for a fixed period of time, then switch back to the internal clock source. The RTOS tick timing is running off of a separate secondary clock source (supplied through Timer 1) so the…