The following document shows an application of a PIC12F1572 μC.
It is schematic and source code of a diesel Generator Set meter. It measures the output voltage and frequency of the Gen-Set and then sends the values to the rest of the system through an optocoupler.
It is not a general use device, it only shows the way I chose to address the demands of a certain application. Since it has a few spots of general interest, I decided to put it up here.
https://drive.google.com/file/d/1rgYGx1pK6jp-s1aE9Fvt10ra82lLEdpH/view?usp=sharing
Have a look if you are interested and drop a comment of what you think about it.
I hope it is helpful,
Have fun.