ARM Technical Support Knowledge Articles

ANALOG COMPARATOR ON AT89C2051

Applies to: uVision Debugger

Answer


Information in this article applies to:


QUESTION

On your website you claim to simulate the Analog Comparator for the Atmel AT89C2051. However, in the µVision Debugger this feature is not in your list of peripherals. Do you support this feature?

ANSWER

Yes, the Analog Comparator is simulated.

There is no dialog because there are no SFRs for this peripheral. This comparator uses AIN0 (P1.0) and AIN1 (P1.1) input pins for analog input and uses bit 6 of Port 3 (P3.6) for the comparator output result. Because of this, P3.6 is not available for general purpose I/O. The MCU sets the comparator output (P3.6) to 1 when the analog input AIN0 (P1.0) is greater than or equal to the analog input AIN1 (P1.1).

You can see the function of the Comparator by setting:

AIN0 = 1.0  AIN1 = 1.5 // gives P3.6=0 (verify in the Port3 dialog)
AIN0 = 2.0  AIN1 = 1.5 // gives P3.6=1 (verify in the Port3 dialog)

SEE ALSO

Article last edited on: 2007-01-12 09:59:32

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential