Secondary oscillator on a PIC16F18425
Posted: Mon May 13, 2024 7:26 pm
Hi all
I am trying to set up a secondary oscillator using a 32.768 KHz xtal to give an accurate tick for a timing counter.
Looking at the data sheet on page 8 pin allocation table it would seem that the SOSC shares the same block on pins 2 & 3 as the OSC1 & OSC2 which is ok as I will use the INT OSC to run the PIC, however I cannot get the interrupt to trigger on the SOSC, It will if I set the interrupt to EXT OSC and run everything from a 4meg xtal.
LEDS on C1 and C5 flash at the expected rate but C2 which is on the SOSC is permanently on.
The reason for doing this is I am finding the 4 MHz xtals that are on the boards are not keeping time with each other unless I match them before assembly which is not practical long term so I thought I could switch the non critical timing to the INTOSC and use a 37KHz timing xtal as a SOSC without changing the pcb design.
I hope I am not trying to achieve the impossible!
Thanks Ian
(edited into correct section)
I am trying to set up a secondary oscillator using a 32.768 KHz xtal to give an accurate tick for a timing counter.
Looking at the data sheet on page 8 pin allocation table it would seem that the SOSC shares the same block on pins 2 & 3 as the OSC1 & OSC2 which is ok as I will use the INT OSC to run the PIC, however I cannot get the interrupt to trigger on the SOSC, It will if I set the interrupt to EXT OSC and run everything from a 4meg xtal.
LEDS on C1 and C5 flash at the expected rate but C2 which is on the SOSC is permanently on.
The reason for doing this is I am finding the 4 MHz xtals that are on the boards are not keeping time with each other unless I match them before assembly which is not practical long term so I thought I could switch the non critical timing to the INTOSC and use a 37KHz timing xtal as a SOSC without changing the pcb design.
I hope I am not trying to achieve the impossible!
Thanks Ian
(edited into correct section)