This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AT89C2051, ADC, Microcontroller,

Hello, I am a student and currently working with AT89C2051. I'm new to this microcontroller. I,m using it in a circuit in which I need to compare a variable analog input to reference voltage using analog comparator of AT89C2051. I need to perform some operations in accordance with the logical output of comaprator. But I've stuck on it and don't know how to use this analog comparator. Please provide me the complete details/ C-code to perform this ASAP..

Parents
  • To answer you question directly.

    Yes you'll be fine. If you write a value to a port that is the same as the existing value nothing will happen on the output of the pin. It will stay at the same level and you will not see any disturbances.

    That said be careful with using PORT when writing and reading. Typically you should write to the PORT and read from the PORT. You can have some funny race conditions if you write to the PORT because of how the processor does read/modify/write to the port bits.

Reply
  • To answer you question directly.

    Yes you'll be fine. If you write a value to a port that is the same as the existing value nothing will happen on the output of the pin. It will stay at the same level and you will not see any disturbances.

    That said be careful with using PORT when writing and reading. Typically you should write to the PORT and read from the PORT. You can have some funny race conditions if you write to the PORT because of how the processor does read/modify/write to the port bits.

Children