I use dsPIC33EP512MU810. I want to make a timer with timer1. I use your timer calculator program and i choosed 1ms interrupt time. i wrote below commands:
Code: Select all
sub procedure InitTimer1()
T1CON = 0x8010
T1IE_bit = 1
T1IF_bit = 0
IPC0 = IPC0 or 0x1000
PR1 = 8750
end sub
sub procedure Timer1Interrupt() iv IVT_ADDR_T1INTERRUPT
T1IF_bit = 0
count=count+1
If count=1000 Then
count=0
Second=Second-1
If Second=255 Then
Second=59
Minute=Minute -1
End If
end if
end sub