Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/24/07 06:53
Modified:
  08/24/07 06:56

Read: times


 
#143574 - measuring a voltage using a \'2051
Responding to: ???'s previous message
Hi Saurabh,


While it is true that you cannot directly read the magnitude of a voltage using the C2051, I seem to recall an old, old ap-note from Atmel showing how to use some resistors, a capacitor and a '2051 using the on-chip comparator and internal timer to create a primitive 'slope ADC'.

I think it worked like this: you have the sampled voltage going into the positive pin, while on the negative pin you have an RC circuit. To start an ADC 'conversion', you first discharge the cap through a port pin via a current limiting resistor. Then you start an interal timer while this capacitor 'ramps up', while the timer is running, you check the state of the comparator output bit, when it changes state, then your ramp voltage equals your sampled level. When the state change occurs, you then stop the timer and read the timer value, which essentially becomes your 'sampled voltage', sort of. Note this method isn't wildly accurate (or linear), but it works.


Hope this helps,

Valentin

List of 3 messages in thread
TopicAuthorDate
Using Analog Comparator in AT89C2051            01/01/70 00:00      
   measuring a voltage using a \'2051            01/01/70 00:00      
      according link            01/01/70 00:00      

Back to Subject List