Page 1 of 1

Need LFINTOSC to Gate HFINTOSC Counts on 16F684

PostPosted: Wed Dec 09, 2020 8:02 pm
by bobledoux
Purpose: Variations in counts may be a source of true random numbers.

Past experimentation can be found here: https://sites.google.com/site/astudyofentropy/project-definition

He uses the watchdog timer (WDT) on an AVR/Arduino to gate the counts from the main clock timer. But the AVR allows the WDT overflow to generate an interrupt, not a program reset as found in the PIC.

I'm attempting to use the low frequency internal oscillator (LFINTOSC) as a gate to count the clock cycles from the high frequency internal oscillator (HFINTOSC).

The 16F684 datasheet, Figure 3.1 notes the LFINTOSC may be used as a main clock or as power up time (PWRT), as watch dog timer (WDT), or as fail-safe clock monitor (FSCM).

Is there any way to access the WDT or FSCM so as to interrupt their functions before they set their interrupts?

This project is programmed in assembler.

Thank you for the feedback.

Bob LeDoux

Re: Need LFINTOSC to Gate HFINTOSC Counts on 16F684

PostPosted: Mon Dec 21, 2020 10:19 am
by ric
Good luck, but I suspect you're not going to find anything that's not shown in "FIGURE 3-1: PICĀ® MCU CLOCK SOURCE BLOCK DIAGRAM"