Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Pulsecapture_isr is slow

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
maxneo

Bascom Member



Joined: 07 Sep 2010
Posts: 35

PostPosted: Thu Jun 04, 2015 9:14 am    Post subject: Pulsecapture_isr is slow Reply with quote

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.

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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