Mega32 Analog Comparator

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

Hey Freaks :D ,

According to the datasheet, if you set the ACBG bit of the ACSR register, a fixed voltage reference replaces the positive input of the comparator. Does this mean that the pin is freed up to be used for another function or do you have to leave it unconnected?

Cheers
Dave.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daveavr wrote:
Does this mean that the pin is freed up to be used for another function or do you have to leave it unconnected?

I assume that you refer to PB2 (AIN0). The diagram in the Analog Comparator section suggests that PB2 would be free for other uses. A quick test could confirm that.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using the internal voltage ref for the comparator and using PWM on PB2, at the same time, and it works (on a tiny26, but it should be the same).

Embedded Dreams
One day, knowledge will replace money.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Nuno!