Comparator Peripheral Labs
reference, the cycle repeats and the system oscillates. The frequency of this oscillation
is dependant on the RC time constant ( τ = R x C), or the time it takes to discharge the
capacitor to 37% of its initial voltage. As either the resistance or capacitance
decreases, so will τ effectively increasing the frequency of the oscillator. If the resistor
is replaced with a Negative Temperature Coefficient (NTC) thermistor where resistance
decreases as temperature increases, any temperature change would cause a shift in
resistance with a subsequent shift in the frequency of the oscillator.
This oscillator can be created quite easily by simply initializing the comparator and
nothing more. However, with the addition of some intelligence and some additional
peripherals, a high resolution sensor measurement application can be achieved.
The PIC16F690 features a 16-bit timer/counter peripheral Timer1. This timer can either
use the internal instruction clock (F OSC /4) as its time base or an external clock source
on the Timer1 Clock Input (T1CKI) pin to increment two 8-bit registers, TMR1H and
TMR1L, to obtain a combined 16-bit result. In this application, the oscillator described
will be used as the Timer1 clock source. Therefore, the TMR1H:TMR1L will increment
with each low-to-high transition effectively counting the number of pulses. The Timer0
peripheral features an interrupt-on-overflow (255-0) that will be used to provide a fixed
time frame in which the TMR1H:TMR1L registers will count. On a Timer0 overflow inter-
rupt, the Timer1 peripheral stops counting and the current value in the upper 4-bits of
TMR1H will be output to four LEDs connected to PORTC pins RC3, RC2, RC1 and
RC0. In order to obtain a usable result, it is important that Timer0 triggers an interrupt
before the TMR1H:TMR1L result overflows. If the temperature to the thermistor
changes, the oscillator frequency will shift resulting in a change in the number of counts
the Timer1 peripheral was able to implement before the fixed Timer0 interrupt with a
different result displayed on the LEDs.
The schematic for this lab is shown in Figure 4-5.
FIGURE 4-5:
SCHEMATIC FOR COMPARATOR LAB 3
R1
100K ?
R2
J8
U2
J9
10K ?
1
2
3
4
5
6
7
8
9
10
T1CKI
RC3
C12IN0-
C1OUT
RC0
RC1
RC2
20
19
18
17
16
15
14
13
12
11
D1
1N4148
C 1
1 μ F
V SS
R3
10K ?
NTC thermistor
V SS
V SS
LED1
? 2009 Microchip Technology Inc.
R4
470 ?
V SS
LED2
R5
470 ?
V SS
LED3
R6
470 ?
V SS
LED4
R7
470 ?
V SS
DS41369A-page 69
相关PDF资料
DM164120-1 BOARD DEMO PICKIT 2 LP COUNT
DM164120-3 BOARD DEMO PICKIT2 28-PIN
DM164120-5 BOARD DEMO PICKIT 2 64/80-PIN
DM164123 KIT MANAGEMENT SYSTEM PICDEM
DM180021 KIT STARTER MPLAB FOR PIC18F MCU
DM183022 BOARD DEMO PIC18FXX22 64/80TQFP
DM183032 BOARD EXPLORER PICDEM PIC18
DM240001 BOARD DEMO PIC24/DSPIC33/PIC32
相关代理商/技术参数
DM163035+TEFLCST3 制造商:Microchip Technology Inc 功能描述:KIT PICDEMLAB+FLOWCODE-HOME BUNDLE/ 制造商:Microchip Technology Inc 功能描述:PICDEM, FLOW CODE, LAB, DEV KIT
DM163045 功能描述:开发板和工具包 - PIC / DSPIC PICDEM Lab Dev Kit (with PICkit 3) RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM1-63-C 功能描述:端子 Metric Fem Disc non-insulated RoHS:否 制造商:AVX 产品:Junction Box - Wire to Wire 系列:9826 线规:26-18 接线柱/接头大小: 绝缘: 颜色:Red 型式:Female 触点电镀:Tin over Nickel 触点材料:Beryllium Copper, Phosphor Bronze 端接类型:Crimp
DM1-63M-C 功能描述:端子 Metric Male Disc non-insulated, 0 RoHS:否 制造商:AVX 产品:Junction Box - Wire to Wire 系列:9826 线规:26-18 接线柱/接头大小: 绝缘: 颜色:Red 型式:Female 触点电镀:Tin over Nickel 触点材料:Beryllium Copper, Phosphor Bronze 端接类型:Crimp
DM164 制造商:SITI 制造商全称:SITI 功能描述:8x3-CHANNEL CONSTANT CURRENT LED DRIVER
DM1640 制造商:SANYO 制造商全称:Sanyo Semicon Device 功能描述:16 characters x 4 line Liquid Crystal Dot Matrix Display Module
DM1640-0AL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic
DM1640-0BL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic