PIC16C84 İle Dijital Kapasite Metre Devresi

| Mayıs 25, 2023 Tarihinde güncellendi
PIC16C84 İle Dijital Kapasite Metre Devresi

Kapasite Ölçerin 4 aralığı vardır. Manuel Modda her aralığın mutlak bir minimum değeri vardır ve 0 ile 16.777.215 arasında bir sayım aralığına karşılık gelen maksimum okuma. uç noktalar her aralık en büyük hatanın oluştuğu yerlerdir, bu nedenle Otomatik Modda aralığı bununla sınırlandırırız en yüksek doğruluğu elde edeceğimiz kısım. Ayrıca, Otomatik Modda sayım aralığının beş özel noktası olduğu görülebilir. Bunlar noktalar aşağıdakilere karşılık gelir:

PCBway Türkiye PCB Manufacturer PCB Assembly

SIFIR: Ölçülebilen mutlak en düşük değer. Otomatik Modda bu SIFIR değeri sadece en düşük aralıkta gösterilir. Manuel modda, tüm aralıklarda görüntülenir. Kapasitörleri değiştirirken birim, Aralık 1’e Otomatik Aralıkla geçer.

DOWNRANGE: Bu, Aralık 1-3’te 4.096’dan ve Aralıklarda 32.768’den daha düşük herhangi bir sayıya karşılık gelir. Aralık 4 . Otomatik Modda, sayım bu değerin altına düşerse sayaç otomatik olarak sonraki en düşük aralık. En düşük aralıktaysa, sayım görüntülenir.

GİRİŞ ARALIĞI: Bu, mevcut ölçekte 5.242 sayıma ve ölçekte 524.288 sayıma karşılık gelir. önceki ölçek Bu, AutoRanging’in bir değerden girdiği değer arasında bir miktar histerezis sağlar. daha düşük aralık ve daha düşük aralıklar daha düşük bir aralığa geri döner. Bu histerezis mevcut değilse, o zaman AutoRanging’in devreye girdiği noktada devre salınım yapabilir.

UPRANGE: Bu, mevcut aralıkta 524.288 sayıya karşılık gelir. Otomatik Modda Devre, bu sayıya ulaşıldığında veya bu sayı aşıldığında bir sonraki daha yüksek aralığa geçişi başlatacaktır. Eğer geçerli aralık en yüksek aralıktır, ardından sayım MAXCOUNT’a kadar devam eder değer.

MAXCOUNT: Bu, 16.777.215’lik Maksimum Sayı değerine karşılık geliyordu. PIC tarafından sağlanan 24 bit ikili sayıcılarla elde edilebilecek maksimum sayım değeri.

Kapasitemetre Devre Şeması

kapasite-metre-devresi-sema

ARALIK 1: Bu aralık, hassas bir 250k direnç ve 100’e bölme harici ön ölçekleyici kullanır bu, ölçüm cihazının Otomatik Modda 0,00 pf ila .00524288 uf (5.242,88 pf) arasında ölçüm yapmasına olanak tanır. Ondalık noktanın arkasındaki basamakların genellikle okumadan okumaya değiştiğinin görüleceğini unutmayın. Bunun nedeni kısmen, sayacın kapasitördeki küçük değişikliklere yanıt vermesi ve uçlarda kaçak kapasitans için.

Uçlara yaklaşmak başıboş kapasitansın değişmesine neden olabilir bir veya iki pikofarad ile. Ayrıca, içeri sızan ve 100’e bölme ön ölçekleyici kullanılması nedeniyle büyütülür. Ancak, sahip olmanın yararlı olduğunu buldum ondalık noktanın arkasındaki fazladan iki basamak. Manuel Modda, aralık 0,00 pf ila .16777216 uf (167.772,16 pf) arasındadır.

ARALIK 2: Bu aralıkta yalnızca 250k hassasiyetli bir direnç kullanılır ve Otomatik Mod aralığı 4.096 pf ila .524288 mikrofarad (524.288 pf). Manuel Modda, aralık 0,000000 uf ile 16,777216 uf (16,777,216 pf) arasındadır.

ARALIK 3: Bu aralık, nominal değeri 2,50k olan kırpılabilir bir direnç kullanır. seçtim birimin birkaç kaynağı telafi edecek şekilde ayarlanabilmesi için değeri ayarlamak için bir düzeltici kap kullanın kullandığım opampın özelliklerinden kaynaklanan hata. Otomatik Mod aralığı .4096’dır. uf ila 52.4288 uf. Manuel Modda, aralık 0,0000 uf ile 1.677.7216 uf arasındadır.

ARALIK 4: Bu aralık, Aralık 3’te kullanılan 2,50k’lik aynı kırpılabilir direnci kullanır, ve bu aralığı Menzil’in tam on katı olacak şekilde genişletmemizi sağlayan 10 ile çarpma devresi 3. Devrenin maksimum doğruluğa sahip olduğu yeri ayarlayabilmemiz için on devre de kırpılabilir. Genel olarak, 100 uf’de maksimum doğruluk için ayarlamak yararlıdır. Otomatik Mod aralığı 32.768 uf ila 16.777.216 uf. Aralık 4’ü ayarlamadan önce daima Aralık 3’ü ayarlayın.
Manuel Modda, aralık 0,000 uf ile 16.777,216 uf arasındadır.

PIC Kapasitans Ölçer’in doğruluğu birkaç faktörden etkilenir. Belirli doğruluk Dirençler, devrenin doğruluğu için kritik öneme sahiptir. İkisi için % .1 hassasiyetli dirençler kullanmayı seçtim Aralık 1’de kullanılan 250k direnci oluşturan dirençler. İki adet %1 hassasiyetli 10.0k seçtim temel doğruluğu için çok önemli olduğundan, oranmetrik karşılaştırıcı bölümü için dirençler TÜM aralıklardaki devre. Diğer dirençler %1 metal film dirençler olarak seçilmiştir. düzelticiler, Aralık 3 ve Aralık 4’teki doğruluğu ayarlamak için kullanılır.

Bu sayacın doğruluğunu test etmek için değeri bilinen bir dizi hassas kapasitör kullandım ve işte burada bulduğum: Aralık 1 ve 2’de, Otomatik Modda çalıştırıldığında doğruluk yaklaşık %0,1’dir. içinde çalıştırıldığında 1 milyonun üzerindeki sayımlarda Manuel Mod, doğruluk yaklaşık %1’e düşer. Aralık 3’te, Otomatik Modda kullanıldığında doğruluk tipik olarak %1’dir. Sayımlarda Manuel Modda 1 milyonun üzerinde doğruluk yaklaşık %3’e düşer. Düzeltici kabının dikkatli bir şekilde ayarlanması sonuç olarak istenen herhangi bir noktanın doğruluğunun % 0,1 içinde olması, ancak bu noktanın üstünde ve altında olması o noktadan uzaklaştıkça doğruluk azalacaktır.

Aralık 4’te doğruluk, Aralık 3 ile ilgili tartışılan tüm aynı faktörlerle sınırlıdır. ek olarak, bu aralık on devre ile çarpılan bir opamp kullanır. Yani doğruluk da etkilenir bu çarpanın doğruluğu ve çarpanın ayrıca görüntüde mevcut olan herhangi bir gürültüyü de çoğaltması. karşılaştırma bölümüne beslenen üçgen dalga. Genel olarak, bu aralığın size %1’den çok daha fazla doğruluk. Bu, aşırı yüksekte %10’a kadar doğruluğa düşebilir aralığın sonları.

Daha iyi bir opamp seçerek devrenin temel doğruluğunu artırabilirsiniz. amplifikatör. TL084’ü seçtim çünkü oldukça iyi, kolayca bulunabiliyor ve ucuz. Orada
daha düşük giriş yanlılığı akımına ve daha yüksek olan bazı pin-pin uyumlu opamp’lar var mı? dönüş oranları ve bunlardan birini takmak size biraz daha fazla doğruluk sağlayabilir.

Asm Yazılımı

;                      CMETERA.ASM
;        Fr. Tom McGahee's PIC CAPACITANCE METER
;
;                   Fr. Thomas McGahee
;             Don Bosco Technical High School
;                    202 Union Ave
;               Paterson, NJ  07502  USA
;
;               [email protected]
;                    (973)595-6655
;
;        permission granted for individual use
;
;                Microchip MPASM format
;       Specifically designed for PIC16C84. Skeleton file.
;

; note: set assembler to case-insensitive, except within strings using /c- option
;

;OPERATIONAL DESCRIPTION OF PROJECT


;the mclear (reset) switch causes a reset and return to autorange.
;the other three switches cause an immediate move to manual mode.
;zeroswitch causes most recent displayed reading to be used as 
;a zero offset. this allows the user to compare two capacitors.
;a + or - sign is displayed to indicate relative value.
;hold key down until updating stops. upon release the
;current value will be displayed.

;first line of lcd displays a + or a blinking - sign in the first
;position. This indicates whether the current displayed value is
;higher or lower than the Comparison Value (normally 0). You may
;"zero-out" any value desired by pressing the ZERO button. This will
;cause the current value to be subtracted from all future readings.
;pressing the ZERO button also forces the unit into Manual Mode.
;you can return to Auto Mode by removing the capacitor and pressing
;the reset button, or by removing the capacitor and turning the
;power off and then on again.

;manual mode can also be entered by pressing either the UP or DOWN
;buttons. (hold button down until updating stops, then release).
;UP and DOWN are used to move from one range to another in Manual Mode.
;unit starts out in Auto Mode, and will automatically switch to the
;best (most accurate) range for any given capacitor. Auto Mode has
;built-in hysteresis to prevent the capmeter from constantly
;cycling between ranges. 

;the second position on the first line is sometimes occupied by a
;blinking letter "M". This indicates that you are in Manual Mode,
;and that the Auto Mode would have issued a command to go to a
;lower range. Obviously in Manual Mode you want to be able to
;change capacitances being measured, and at such a time the value
;being measured will temporarily go to zero, causing this feature
;to kick in.

;the rest of the first line is allocated to the display of the current
;count. internally a 24 bit counter allows the accumulation of counts
;up to 16,777,216. In Auto Mode the AutoRanging kicks in at around
;524,288 to range UP, and below 32,768 it shifts DOWN. There are 4
;ranges. In the lowest range it allows a display of from .00 pf to
;5,242.88 pf. range 2 ranges from 4,096 pf to 524,288 pf. range 3
;ranges from .4096 uf to 52.4288 uf. range 4 ranges from 32.768 uf
;to 16,777.216 uf.

;in Manual Mode you can generate counts from 0 to 16,777,216
;but the accuracy outside the above specified ranges can then
;have an error greater than 1%. use autoranging for maximum
;accuracy. use Manual Mode when using the Comparison feature
;or when you don't want the unit to AutoRange. AutoRanging to zero
;always causes the unit to go to range 1 for zero. then when you
;attach a new capacitor it may take a few seconds before AutoRanging
;detects an aout-of-range condition and responds. by the way, to
;speed up from such zero excursions I have implemented the UP Range
;portion of the AutoRange so that it always goes to range 4. I do
;this because it is always quicker to down range than it is to up
;range. there is method to my madness!

;values are displayed properly positioned over the value identifiers
;such as uf nf and pf. a space is provided between each set of 3
;digits to reflect standard engineering notation. partial number
;sets are padded with _ to the right. numbers have leading zeros
;suppressed up to the decimal point. commas are added where they are
;appropriate. 

;note that sometimes many more digits are displayed than the accuracy
;warrants. in general you can trust the first 3 digits to be right
;on. the 4th digit is normally accurate +/- 1 count. additional
;digits are displayed not for additional accuracy, but simply because
;they are useful for watching variations due to temperature, etc.,
;and they are useful in matching two or more capacitors.

;basic accuracy is 1% or better within the AutoRanging values
;up to about 100 uf. by the time you get a measurement like
;16,000.000 uf the time to collect such a measurement has risen to
;almost 24 seconds. this causes the accumulated error to rise
;to a few percent.

;the first position on the second line will display a number from
;1 to 4. this represents the current range, where 1 is the lowest
;range. the middle section of the second line contains the uf
;nf and pf indicators, positioned directly below the numeric groups
;that they refer to. I chose to display more than one set of
;indicators so you can easily read something like:
;
;+     12,000.___ 
;2 fd  nf  pf A**
;
;as either .012 uf   12.000 nf    or  12,000 pf.

;after the uf/nf/pf indicators there is either an "A" or an "M"
;displayed as an indicator of either Manual or Auto Mode being
;active. this is followed by two locations that display an
;animated (moving) black box to indicate that a new count is
;in progress. this is replaced by ** to indicate that the
;on-screen count has just been updated. These asterisks will
;remain on-screen until the circuitry detects edge synchronization.
;then the flashing black boxes appear. to speed up the
;synchronization process I have separate routines for handling
;rising and falling edges.

;occassionaly you will see a message such as "OVER-RANGE!" when
;in the manual mode. if the number is still displayed, then this is
;just a cautionary warning that the displayed value lies outside
;the range where it can be guaranteed to be 1% accurate.
;if the message is the *only* thing displayed on the screen,
;then you have exceeded the 16 million count limit and really
;need to switch to a higher range.
;
;during AutoRanging a quick flash of the word "AUTORANGING" will
;appear, and you may hear a click from the internal relays. some
;ranges switch without the click sound because they are using
;external counters to switch ranges.

;a note of caution when using Manual Mode: if you have set the
;device to operate in Comparison Mode by pressing the ZERO
;button, this zero comparison value will be retained *for the
;current numbered range* even if you move to another scale.
;before moving to another scale it is therefore a good idea
;to remove the cap being measured and press the ZERO button to
;re-zero the scale. if you don't do this, then the next time
;you return to that range the Comparison value will again
;be in effect. there is nothing wrong with bridging a comparison
;over two different ranges. if you want to do that, you
;have to press the ZERO button at *each* range you want to
;perform the comparison on.

;because the ZERO button automatically causes entry into the
;Manual Mode, you usually can't run Comparison Mode in 
;Auto Mode. however, *if* you hit the reset button and have 
;a capacitor attached, the reset auto-zero feature will
;cause the current cap value to be subtracted on *every* range.
;this works with values up to about 1 uf with no problem.
;larger values will cause overflow errors on the lower ranges
;and may therefore give erroneous readings. also note that the
;time required to perfom the auto-zero function increases
;with increasing external capacitance. if the cap value is more than
;a few uf then the auto-zero logic may cause the circuitry to
;cycle endlessly in an attempt to zero the lower ranges.
;if that happens, remove the capacitor and perform a reset.





;
; directives
;


;
; note: written in all lower case so case sensitivity doesn't matter.
; however: set assembler to case-insensitive, except within strings using /c- option
;

;
; directives
;



		list		p=pic16f84	;this directive must come first

; instead of using the [ include <16f84.inc> ] we have placed the contents of the
; microchip supplied include file below for documentation purposes.
;
; P16F84.INC  Standard Header File, Version 2.00    Microchip Technology, Inc.

; This header file defines configurations, registers, and other useful bits of
; information for the PIC16F84 microcontroller.  These names are taken to match 
; the data sheets as closely as possible.  

; Note that the processor must be selected before this file is 
; included.  The processor may be selected the following ways:

;       1. Command line switch:
;               C:\ MPASM MYFILE.ASM /PIC16F84
;       2. LIST directive in the source file
;               LIST   P=PIC16F84
;       3. Processor Type entry in the MPASM full-screen interface
;==========================================================================
;
;       Verify Processor
;
;==========================================================================

        IFNDEF __16F84
           MESSG "Processor-header file mismatch.  Verify selected processor."
        ENDIF

;==========================================================================
;
;       Register Definitions
;
;==========================================================================

W                            EQU     H'0000'
F                            EQU     H'0001'

;----- Register Files------------------------------------------------------

INDF                         EQU     H'0000'
TMR0                         EQU     H'0001'
PCL                          EQU     H'0002'
STATUS                       EQU     H'0003'
FSR                          EQU     H'0004'
PORTA                        EQU     H'0005'
PORTB                        EQU     H'0006'
EEDATA                       EQU     H'0008'
EEADR                        EQU     H'0009'
PCLATH                       EQU     H'000A'
INTCON                       EQU     H'000B'

OPTION_REG                   EQU     H'0081'
TRISA                        EQU     H'0085'
TRISB                        EQU     H'0086'
EECON1                       EQU     H'0088'
EECON2                       EQU     H'0089'

;----- STATUS Bits --------------------------------------------------------

IRP                          EQU     H'0007'
RP1                          EQU     H'0006'
RP0                          EQU     H'0005'
NOT_TO                       EQU     H'0004'
NOT_PD                       EQU     H'0003'
Z                            EQU     H'0002'
DC                           EQU     H'0001'
C                            EQU     H'0000'

;----- INTCON Bits --------------------------------------------------------

GIE                          EQU     H'0007'
EEIE                         EQU     H'0006'
T0IE                         EQU     H'0005'
INTE                         EQU     H'0004'
RBIE                         EQU     H'0003'
T0IF                         EQU     H'0002'
INTF                         EQU     H'0001'
RBIF                         EQU     H'0000'

;----- OPTION Bits --------------------------------------------------------

NOT_RBPU                     EQU     H'0007'
INTEDG                       EQU     H'0006'
T0CS                         EQU     H'0005'
T0SE                         EQU     H'0004'
PSA                          EQU     H'0003'
PS2                          EQU     H'0002'
PS1                          EQU     H'0001'
PS0                          EQU     H'0000'

;----- EECON1 Bits --------------------------------------------------------

EEIF                         EQU     H'0004'
WRERR                        EQU     H'0003'
WREN                         EQU     H'0002'
WR                           EQU     H'0001'
RD                           EQU     H'0000'

;==========================================================================
;
;       RAM Definition
;
;==========================================================================

        __MAXRAM H'CF'
        __BADRAM H'07', H'50'-H'7F', H'87'

;==========================================================================
;
;       Configuration Bits
;
;==========================================================================

_CP_ON                       EQU     H'000F'
_CP_OFF                      EQU     H'3FFF'
_PWRTE_ON                    EQU     H'3FF7'
_PWRTE_OFF                   EQU     H'3FFF'
_WDT_ON                      EQU     H'3FFF'
_WDT_OFF                     EQU     H'3FFB'
_LP_OSC                      EQU     H'3FFC'
_XT_OSC                      EQU     H'3FFD'
_HS_OSC                      EQU     H'3FFE'
_RC_OSC                      EQU     H'3FFF'


;end of  file stuff

;define stuff that microchip in their wisdom re-named.
; this is in case we use the identifiers in the original data sheets by accident

ind0		equ		h'00'		;file address. microchip calls it indf		
rtcc		equ		h'01'		;file address. microchip calls it tmr0
;
;<
pic16c84-ile-dijital-kapasite-metre-devresi

Şifre-Pass: 320volt.com

Yayım tarihi: 2009/02/02 Etiketler: , , , , , ,



Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir