compare voltage

Hi,

my program:

EP: MOV A,ADC0H
CJNZ A,#175D,EP

i have problem jumping to the next subrountine

when i detect 1.75V from power supply
it will start to display
if not it will display 0V

any advice?

Parents
  • Long time since I had to care abot '51 assembly but:

    CJNZ = Compare Jump Not Zero

    You are comparing if the voltage is exactly 1.75V or not. Are you sure you want to catch exactly 1.75V, and not want to check for voltages above or below? AD converters are not exact. They always measure with a tolerance and with jitter from noise.

    Also, if you want to jump to another routine, don't you think your code should specify a jump to that other routine? Where do you think your code will jump?

Reply
  • Long time since I had to care abot '51 assembly but:

    CJNZ = Compare Jump Not Zero

    You are comparing if the voltage is exactly 1.75V or not. Are you sure you want to catch exactly 1.75V, and not want to check for voltages above or below? AD converters are not exact. They always measure with a tolerance and with jitter from noise.

    Also, if you want to jump to another routine, don't you think your code should specify a jump to that other routine? Where do you think your code will jump?

Children
More questions in this forum