Hello!
I'm almost as new in programming pic microcontrollers in assembly language.
What i tried to do in program, is to compare two results of AD conversion, by subtracting previous, from the current result of conversion. If the previous result is greater then the current, diode should be turned off and the program stops, otherwise it's turned on. Measured (input) voltage is from potentiometer 10k. Frequency is at 8 MHz. Problem is that diode is turned off, with no matter if the previous voltage is grater or not. On reset the situation is like it should be before reset, until the resistance is changed. It seems that the CARRY flag is cleared whenever input voltage is beeing changed. Help me please!!!!
I'm almost as new in programming pic microcontrollers in assembly language.
What i tried to do in program, is to compare two results of AD conversion, by subtracting previous, from the current result of conversion. If the previous result is greater then the current, diode should be turned off and the program stops, otherwise it's turned on. Measured (input) voltage is from potentiometer 10k. Frequency is at 8 MHz. Problem is that diode is turned off, with no matter if the previous voltage is grater or not. On reset the situation is like it should be before reset, until the resistance is changed. It seems that the CARRY flag is cleared whenever input voltage is beeing changed. Help me please!!!!
Attachments
Last edited: