Keil Logo

µVISION DEBUGGER: ANALOG COMPARATOR ON AT89C2051


Information in this article applies to:

  • µVision Version 2 and Later

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

Last Reviewed: Friday, January 12, 2007


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.