CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Erratic Timer0? (shoud be easy answer)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Mon Aug 30, 2004 12:17 pm     Reply with quote

Hmmm.... I see what you're saying. The line:

0000: 29 95 2D 96 C7 3E 70 3D

from my original data would be X*2, to get it back to captured number, then would be *1.5 to get the actuall count since I though timer1 was counting every 1us and its really every 1.5us...


Quote:

The largest error is this one:
storage[i]=(fall-prise)/2;

I'm confused as to the fall-prise time problem... Both of those are CCP captured varaibles, so they should just be relative to each other, no? If there is a relative problem in the data I can sort it out, but shouldn't this be (332x - 272x) / 2== 30x where x is my ticks per uS? (I just picked easy numbers)

I have to use somthing other then microchips method b/c it doesnt count the low pulses, just the highs (i think). I need to count both.

When you say
Quote:
... A div2 isn't enough, better try a div 10 (or a much faster div 16 which is basically a shift operation).

You mean when I /2 to my pulse times or do you mean a DIV_2 or DIV_16 on the timer? I know none of my pulses except an inactive period will be more then 255, but I figured a /2 would let me store at most a 9 bit time. I see no problem trying out a /16 on my scaler.

I thought this was an OK way to go, it uses two ccps, but only one interupt... I think I understand things better in code cause English isn't exactly my strong point.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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


Powered by phpBB © 2001, 2005 phpBB Group