Good morning everyone,
I am trying to program a PIC18F4520 so that when one of the ADC readings (CH0 or CH1) reach a certain threshold the PIC will go in to an 'alarm state' and will continue in that state until the device is reset by the MCLR pin.
At the moment, when the ADC reaches the threshold it will go in to the 'alarm state' but when the ADC value changes it will go back to normal condition and what I want is for it to "Latch" and stay in the 'alarm state' until reset, as explained above.
How could I implement this?
Thanks in advanced for any given help.
/***************************************************************************************************/
PS: I am using C language in C18 compiler
I am trying to program a PIC18F4520 so that when one of the ADC readings (CH0 or CH1) reach a certain threshold the PIC will go in to an 'alarm state' and will continue in that state until the device is reset by the MCLR pin.
At the moment, when the ADC reaches the threshold it will go in to the 'alarm state' but when the ADC value changes it will go back to normal condition and what I want is for it to "Latch" and stay in the 'alarm state' until reset, as explained above.
How could I implement this?
Thanks in advanced for any given help.
/***************************************************************************************************/
PS: I am using C language in C18 compiler