here is the code, well I would like to know if there is any observation that can be important to change.
For example the definitions of goto's in the ISR routine, and how about the complexity of the ISR routine, and some others at the begining of the code, like ORG 0x00, ORG 0x05, ORG 0x04
well, this code should done the following read 3dip switches at RB7,6,5
111, set a delay of 20ms
110, set a delay of 100ms
101, set a delay of 300ms
100, set a delay of 500ms
011, set a delay of 1000ms=1sec
x, don't care
x
x
RB4, define a manual mode or automatic mode, auto=1 manual=0
RB3 and 2
11 set the ADC to detect 1.25v aprox
10 set the ADC to detect 2.5v
01 set the ADC to detect 3.25v
00 x
RB0 is an external interrupt that will increment C_DF
if C_DF =>31 the system will stop to enclave
AN0 is the analog input
RA1, led system on
RA2, led TM, a TM event occurs
RA3, LED DF, a DF event occurs
RA4, turns on a relay for about 50ms to close an interruptor
RA5, turns on a relay for about 50ms to open an interruptor
TM events occurs without notice, so by polling the firmware a TM event is detected
I think that's all, see you