ComparatorComparator PIC 12F675PIC 12F675 Zdeněk Matěj 72963@mail.muni.cz ComparatorComparator ►The PIC12F629/675 devices have one analogThe PIC12F629/675 devices have one analog comparatorcomparator ►Compare two analog valuesCompare two analog values ►On GP0 and GP1 are inputs to theOn GP0 and GP1 are inputs to the comparatorcomparator ►GP2 can be the comparator outputGP2 can be the comparator output ►Generates interrupt (CMIF)Generates interrupt (CMIF) Comparator - CMCONComparator - CMCON Comparator – operation modesComparator – operation modes Comparator – voltage referenceComparator – voltage reference ►The voltage reference can output 32 distinctThe voltage reference can output 32 distinct voltage levelsvoltage levels Comparator – voltage referenceComparator – voltage reference Comparator - exampleComparator - example //init//init // - COUT - CINV CIS CM2 CM1 CM0// - COUT - CINV CIS CM2 CM1 CM0 CMCON=0;CMCON=0; output=COUT;output=COUT; ReferencesReferences Source:Source: http://ww1.microchip.com/downloads/en/devhttp://ww1.microchip.com/downloads/en/deviicedoc/41190c.pdfcedoc/41190c.pdf