[B]Device [/B]= 18F452
[B]Clock [/B]= 20
[B]Structure [/B]TTime
Hours [B]As Byte[/B]
Minutes [B]As Byte[/B]
Seconds [B]As Byte[/B]
Milli_Seconds [B]As Word
End Structure
Dim [/B]Time [B]As [/B]TTime
[B]Interrupt [/B]TMR_Interrupt()
[B]Inc[/B](Time.Milli_Seconds)
[B]If [/B]Time.Milli_Seconds = 1000 [B]Then[/B]
Time.Milli_Seconds = 0
Time.Seconds = Time.Seconds + 1
[B]If [/B]Time.Seconds = 60 [B]Then [/B]
Time.Seconds = 0
Time.Minutes = Time.Minutes + 1
[B]If [/B]Time.Minutes = 60 [B]Then[/B]
Time.Hours = Time.Hours + 1
[B]EndIf
EndIf
EndIf
End Interrupt[/B]
Setup_Timer
[B]Enable[/B](TMR_Interrupt)
[B]
While True
Wend[/B]