Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
InputCaptureEx oddity

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
GTBecker



Joined: 18 Jan 2006
Posts: 508
Location: Cape Coral

Posted: 02 August 2012, 1:25 AM    Post subject: InputCaptureEx oddity Reply with quote

I'm using InputCaptureEx to measure the high and low periods of a '555 output cycle, usually correctly. Maybe 1% of the time, however, I see an entire cycle, not just a high or low period, in the high (first) count. For example:
ZX-24n:
Code:
2127 1015
2120 1016
2112 1017
2117 1020
3097 1021 **
2127 1030
2140 1044
2149 1055
2144 1047

ZX24:
Code:
2159 1013
2152 1014
2152 1013
2152 1014
3111 1013 **
2155 1014
2155 1014
2147 1015
2148 1015

What might cause this?

Later edit:
I see different behavior if the capture starts on the falling edge:
ZX-24n:
Code:
1027 2148
1027 2148
1027 2152
1025 2153
995 2155
1024 2158
1024 2157
1024 2159
1027 2165

Here the low period is occasionally a few percent short, but I do not see the full-cycle error. In both cases, scoping the signal shows some jitter, and some ground noise, but no glitches.
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 693

Posted: 02 August 2012, 14:38 PM    Post subject: Reply with quote

The only thing that I can think of is that another task is blocking interrupts at just the wrong moment. Does your application have other tasks that might interfere with input capture interrupt servicing?

You might try to strip down your program so that it only records the input capture, but does nothing else at the time. That might eliminate the possibility of another task interfering with the input capture.

-Tony
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 508
Location: Cape Coral

Posted: 02 August 2012, 18:01 PM    Post subject: Reply with quote

I am using three simple tasks (sampling, display and command receipt) but I'm not deliberately blocking interrupts anywhere. I found, though, that placing a pair of Locktask/Unlocktask functions around the capture served only to prevent remote downloads via AtnChar (the project is in a box at the wellhead and talks via Bluetooth). They had no effect on the capture.

I'm leaning toward a dirty signal so I'm going to try slowing the risetime of the '555 a little - and substitute a clean bench-generated squarewave - to see what that does.
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 508
Location: Cape Coral

Posted: 11 August 2012, 1:49 AM    Post subject: Reply with quote

As should be the case, a clean 400Hz squarewave is measured accurately by InputCaptureEx. I also tried capturing four periods so I could use the third and fourth periods to avoid the first two suspect periods; the result was the same as capturing two periods. I guess the '555 and processor breadboard is sufficiently noisy to cause the '555 to trigger irregularly.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2013 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group