| Electronic Components Datasheet Search |
|
PIC16C781 Datasheet(PDF) 91 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC16C781 Datasheet(HTML) 91 Page - Microchip Technology |
|
91 / 186 page ![]() 2001 Microchip Technology Inc. Preliminary DS41171A-page 89 PIC16C781/782 12.0 COMPARATOR MODULE The comparator module has two separate voltage com- parators: Comparator C1 and Comparator C2 (see Figure 12-1). Each comparator offers the following list of features: • Control and configuration register • Comparator output available externally • Programmable output polarity • Interrupt-on-change flags • Wake-up from SLEEP • Configurable as feedback input to the PSMC • Programmable four input multiplexer • Programmable reference selections • Programmable speed • Output synchronization to Timer1 clock input (Comparator C2 only) 12.1 Control Registers Both comparators have separate control and configura- tion registers: CM1CON0 for C1 and CM2CON0 for C2. In addition, Comparator C2 has a second control regis- ter, CM2CON1, for synchronization control and simul- taneous reading of both comparator outputs. 12.1.1 COMPARATOR C1 CONTROL REGISTER The CM1CON0 register (shown in Register 12-1) con- tains the control and status bits for the following: • Comparator enable • Comparator input selection • Comparator reference selection • Output mode • Comparator speed Setting C1ON (CM1CON0<7>) enables Comparator C1 for operation. Bits C1CH<1:0> (CM1CON0<1:0>) select the compar- ator input from the four analog pins AN<7:4>. Setting C1R (CM1CON0<2>) selects the output of the DAC module as the reference voltage for the compara- tor. Clearing C1R selects the VREF1 input on the RA3/ AN3/VREF1 pin. The output of the comparator is available internally via the C1OUT flag (CM1CON0<6>). To make the output available for an external connection, the C1OE flag (CM1CON0<5>) must be set. If the module is disabled with C1OE set, the output will be driven as shown in Table 12-2: The polarity of the comparator output can be inverted by setting the C1POL flag (CM1CON0<4>). Clearing C1POL results in a non-inverted output. A complete table showing the output state versus input conditions and the polarity bit is shown in Table 12-2. C1SP (CM1CON0<3>) configures the speed of the comparator. When C1SP is set, the comparator oper- ates at its normal speed. Clearing C1SP operates the comparator in a slower, low power mode. Note: To use AN<7:4> as analog inputs, the appropriate bits must be programmed in the ANSEL register. TABLE 12-1: OUTPUT STATE VERSUS INPUT CONDITIONS Input Condition C1POL C1OUT C1VN > C1VP 0 0 C1VN < C1VP 0 1 C1VN > C1VP 1 1 C1VN < C1VP 1 0 Note 1: The internal output of the comparator is latched at the end of each instruction cycle. External outputs are not latched. 2: The C1 interrupt will operate correctly with C1OE set or cleared. 3: For the output of C1 on RB6/C1/ PSMC1A, the PSMC must be disabled and TRISB<6> must be ‘0’. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |