Posted: Thu Jun 04, 2015 9:14 am Post subject: Pulsecapture_isr is slow
Hello I have a problem with timing see the example.
Pulsecapture_isr:
Cnt = Capture1 'Get the current pulse value
Timer 1 = 0
'If Pinb.0 = 1 Then
'Tccr1b.ices1 = 0
'Else
'Tccr1b.ices1 = 1
'End If
Toggle Tccr1b.ices1
If Cnt> Syncpulse Then 'Check for sync pulse
Sync = Cnt 'save the current pulse value for debug
Z = 1
'Sets the index to the first channel
Elseif Z <4 Then 'Assign 1-3 and then wait for the sync pulse
Chan (z) = Cnt 'Assign the pulse value to the proper channel
Incr Z 'next channel ...
If Z = 4 Then Z = 0
End If
I test Pinb.0 to see if it is hay or low, but the routine is to slow sometimes not found the pulse so I took it off and put to toggle and it works but it feel not quite sure. As to my question, I can do this routine a little faster for exampel with asm grateful for the answer.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum