ok Comparators seem really cool! can someone link me to a tutorial heh? I have no clue how to use them. Also can you use external comparators? I would like to play with external ones also to better understand how they are used.
Here is an "improved" way of using the comparator. Note that I'm now using an external means of setting the trip level that makes the math from converting timer reading to capacitance easy. The underlying math is shown here.
Also note that I am using the same PIC pin to initially discharge the capacitor by initially setting the pin as a low digital output, and then subsequently setting it to an analog input, which allows the capacitor to begin charging. The comparator trips and generates the interrupt to save the timer value when the capacitor charges to ~3.79V, which is one RC time constant, which makes the math easy.
im sorry for not understanding much still maybe because i dont know how comparators work or how to set one up but i still dont understand why you need that Pot. there? Why do i need a external reference voltage? Why not use internal VDD,VSS ?
im sorry for not understanding much still maybe because i dont know how comparators work or how to set one up but i still dont understand why you need that Pot. there? Why do i need a external reference voltage? Why not use internal VDD,VSS ?
im working my way there heh. I am going to try and use 16F630. I wrote some code for UART where i can send and receive at 9600bps. All software which was tough in boostC heh...
going to play with comparator now... wish me luck!
You know your ARM chip is loaded with comparators, make them part of your arsenal! They are much faster than an ADC, issue an output as soon as your input exceeds your reference. I'm sure you've googled off on comparators; you know where to find the info you need.