Analog Comparator attiny45

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

im probably going to word this badly but anyway so I'm having trouble understanding how to use the Analog Comparator in table 17-4 page 135 in the datasheet it shows MUX 3-0.  Im trying to measure a small voltage 50mv to 10mv from a current resistor (one side is grounded) so i was thinking the gain amplifier would be of use to me if MUX is 1001 the pos and neg are pb5 how dose this work? if i can get away with one pin that would be great because i need two pwm's from port a or port b, one separate pwm, and one pin for waking (from power down mode)   

 

http://ww1.microchip.com/downloa...

This topic has a solution.
Last Edited: Fri. Dec 1, 2017 - 06:37 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Analog comparator?

 

Surely you mean Analog-to-digital converter.

 

The channel you've mentioned (channel 9) is used to calibrate the offset of the ADC.  The same signal is applied to both ends of the differential channel then passed through the 20x gain stage.  The ADC results should reflect the offset error in the ADC, which you can then use to correct later readings taken from a true 20x differential channel, like 0111 or 1011.

 

Note that 0100, 0101, 1000, and 1001, are all calibration channels where both ends are taken from the same pin.

 

In fact, the table you reference has a footnote:   1. For offset calibration, only. See “Operation” on page 123:

If ADC0 or ADC2 is selected as both the positive and negative input to the differential gain amplifier (ADC0-ADC0 or ADC2-ADC2), the remaining offset in the gain stage and conversion circuitry can be measured directly as the result of the conversion. This figure can be subtracted from subsequent conversions with the same gain setting to reduce offset error to below 1 LSW.

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Fri. Dec 1, 2017 - 05:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks thats what i needed to know