Hi all.
I need some hints/tips/tricks/help !?
The simple program below runs for approx. 10-15 min. and the it totally freezes up, not even the interrupt works. ?!
Origianlly the projectboard is connected with the AXE033 LCD, but all that code is removed in the program, but that didn't help.
------Program------
'The analouge input on channel 3 are coming
'from an O2 transmitter that gives 0-10VDC (0-20,9% O2)
'the voltage is divided via. to equal resistors and a trim-pot.
'The output 4 is connected to a 5VDC relay with a back emf
'suppression diode across the relay coil.
'The contactor of the relay controls a 230VAC motor.
'The input on pin1 is an other relay (230VAC) the contacts
'shorts the +V and pin1
'The input on pin2 is an normal switch.
------Program------
init:
setint %00000100,%00000100 'Set interrupt pin 2 (Start motor, override)
main:
readadc 3,b10 'read analog channel 3 into b10
if pin1 = 1 then O2eval 'If pin1 id high goto O2 evaualtion
goto main
O2eval:
if b10 > 120 then O2_Too_high 'O2% way too high
if b10 > 105 then O2_High 'O2% high
if b10 > 85 then O2_OK 'O2% OK
if b10 <= 85 then O2_Low 'O2% low
goto main 'Loop
O2_Too_high:
high 4 'start motor
pause 10000 'wait 10 sec.
low 4 'stop motor
pause 5000 'vent 5 sec.
goto main 'Loop
O2_High:
high 4 'start motor
pause 5000 'wait 5 sec.
low 4 'stop sneglemotor
pause 3000 'wait 3 sec.
goto main 'Loop
O2_OK:
high 4 'start motor
if pin1 = 1 then O2_OK 'keep output 4 high as log as input 1 is high
low 4 'stop motor
goto main 'Loop
O2_Low:
pause 3000 'Block motor for 3 sec.
goto main 'Loop
Interrupt:
high 4 'start motor
if pin2 = 1 then Interrupt 'keep output 4 high as long as pin 2 is high
low 4 'stop motor
setint %00000100,%00000100 'reset interrupt pin 2
return 'Return from interrupt
I need some hints/tips/tricks/help !?
The simple program below runs for approx. 10-15 min. and the it totally freezes up, not even the interrupt works. ?!
Origianlly the projectboard is connected with the AXE033 LCD, but all that code is removed in the program, but that didn't help.
------Program------
'The analouge input on channel 3 are coming
'from an O2 transmitter that gives 0-10VDC (0-20,9% O2)
'the voltage is divided via. to equal resistors and a trim-pot.
'The output 4 is connected to a 5VDC relay with a back emf
'suppression diode across the relay coil.
'The contactor of the relay controls a 230VAC motor.
'The input on pin1 is an other relay (230VAC) the contacts
'shorts the +V and pin1
'The input on pin2 is an normal switch.
------Program------
init:
setint %00000100,%00000100 'Set interrupt pin 2 (Start motor, override)
main:
readadc 3,b10 'read analog channel 3 into b10
if pin1 = 1 then O2eval 'If pin1 id high goto O2 evaualtion
goto main
O2eval:
if b10 > 120 then O2_Too_high 'O2% way too high
if b10 > 105 then O2_High 'O2% high
if b10 > 85 then O2_OK 'O2% OK
if b10 <= 85 then O2_Low 'O2% low
goto main 'Loop
O2_Too_high:
high 4 'start motor
pause 10000 'wait 10 sec.
low 4 'stop motor
pause 5000 'vent 5 sec.
goto main 'Loop
O2_High:
high 4 'start motor
pause 5000 'wait 5 sec.
low 4 'stop sneglemotor
pause 3000 'wait 3 sec.
goto main 'Loop
O2_OK:
high 4 'start motor
if pin1 = 1 then O2_OK 'keep output 4 high as log as input 1 is high
low 4 'stop motor
goto main 'Loop
O2_Low:
pause 3000 'Block motor for 3 sec.
goto main 'Loop
Interrupt:
high 4 'start motor
if pin2 = 1 then Interrupt 'keep output 4 high as long as pin 2 is high
low 4 'stop motor
setint %00000100,%00000100 'reset interrupt pin 2
return 'Return from interrupt