okay. I try to make a interrupt. One interrupt per second.
I have the following problem. For example:
- pumps running - it means actual time = starting time
- Power outage appears
- Power restore
- pumps are off - I compare actual time vs. starting time. it is passed but runtime is in range.
Next question. I use RTC DS1307. It is possible to get an interrupt per second from RTC ?
[code:1:5846c4c05a]
'-------------------------------Interrupt--------------------------------------
Interrupt:
If Current_program = 1 Then
If Program_a1(1) <> 0 Then
If Hours = Program_a1(1) And Minutes = Program_a1(2) Then 'comparing actual time vs. starting time
Start_runtime = 1
End If
If Start_runtime = 1 Then
Runtime_start = Program_a1(3)
Sec_runtime = Runtime_start * 60 ' convert runtime(minutes) to seconds
Set Valve1
Incr Runtime
Incr S
If Runtime = Sec_runtime Then 'comparing runtime vs. number of seconds interrupt
Reset Valve1
Runtime = 0
Start_runtime = 0
End If
End If
End If
End If
Timer1 = 34286
Return[/code:1:5846c4c05a]
↧