| поискавой системы для электроныых деталей |
|
41594B датащи(PDF) 152 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
41594B датащи(HTML) 152 Page - Microchip Technology |
|
152 / 372 page ![]() PIC12LF1840T48A DS41594B-page 152 Preliminary 2011-2012 Microchip Technology Inc. 19.3 Comparator Hysteresis A selectable amount of separation voltage can be added to the input pins of each comparator to provide a hysteresis function to the overall operation. Hysteresis is enabled by setting the C1HYS bit of the CM1CON0 register. See Section 31.0 “Electrical Specifications” for more information. 19.4 Timer1 Gate Operation The output resulting from a comparator operation can be used as a source for gate control of Timer1. See Section 21.6 “Timer1 Gate” for more information. This feature is useful for timing the duration or interval of an analog event. It is recommended that the comparator output be syn- chronized to Timer1. This ensures that Timer1 does not increment while a change in the comparator is occur- ring. 19.4.1 COMPARATOR OUTPUT SYNCHRONIZATION The output from comparator C1 can be synchronized with Timer1 by setting the C1SYNC bit of the CM1CON0 register. Once enabled, the comparator output is latched on the falling edge of the Timer1 source clock. If a prescaler is used with Timer1, the comparator output is latched after the prescaling function. To prevent a race condition, the comparator output is latched on the falling edge of the Timer1 clock source and Timer1 increments on the rising edge of its clock source. See the Comparator Block Diagram (Figure 19-2) and the Timer1 Block Diagram (Figure 21-1) for more information. 19.5 Comparator Interrupt An interrupt can be generated upon a change in the output value of the comparator for each comparator, a rising edge detector and a Falling edge detector are present. When either edge detector is triggered and its associ- ated enable bit is set (C1INTP and/or C1INTN bits of the CM1CON1 register), the Corresponding Interrupt Flag bit (C1IF bit of the PIR2 register) will be set. To enable the interrupt, you must set the following bits: • C1ON, C1POL and C1SP bits of the CM1CON0 register • C1IE bit of the PIE2 register • C1INTP bit of the CM1CON1 register (for a rising edge detection) • C1INTN bit of the CM1CON1 register (for a falling edge detection) • PEIE and GIE bits of the INTCON register The associated interrupt flag bit, C1IF bit of the PIR2 register, must be cleared in software. If another edge is detected while this flag is being cleared, the flag will still be set at the end of the sequence. 19.6 Comparator Positive Input Selection Configuring the C1PCH<1:0> bits of the CM1CON1 register directs an internal voltage reference or an analog pin to the non-inverting input of the comparator: • C1IN+ analog pin •DAC • FVR (Fixed Voltage Reference) •VSS (Ground) See Section 14.0 “Fixed Voltage Reference (FVR)” for more information on the Fixed Voltage Reference module. See Section 17.0 “Digital-to-Analog Converter (DAC) Module” for more information on the DAC input signal. Any time the comparator is disabled (C1ON = 0), all comparator inputs are disabled. Note: Although a comparator is disabled, an interrupt can be generated by changing the output polarity with the C1POL bit of the CM1CON0 register, or by switching the comparator on or off with the C1ON bit of the CM1CON0 register. |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |