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

answare pls ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
procos



Joined: 15 Dec 2004
Posts: 12

View user's profile Send private message

answare pls ?
PostPosted: Mon Dec 20, 2004 5:32 am     Reply with quote

i can count puls over 65536 with PIC ?
wath PIC ?
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Mon Dec 20, 2004 5:54 am     Reply with quote

Yes you can, use a PIC with a capture module and a fast crystal. Tell us more anout your application.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Dec 20, 2004 7:51 am     Reply with quote

Do you just want to count more that 16 bits?
Just have a software loop check the MSB of a 16 bit counter. By the time you divide anything by 65K it is pretty slow so software can track overflows and add as many more bits to the counter as you want.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Guest








PostPosted: Mon Dec 20, 2004 1:00 pm     Reply with quote

SherpaDoug wrote:
Don't blame me I'm from a blue state


Thank God for red states.... Very Happy
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Dec 20, 2004 1:23 pm     Reply with quote

Anonymous wrote:
SherpaDoug wrote:
Don't blame me I'm from a blue state


Thank God for red states.... Very Happy


He signed in as "Guest". Must be another Red voter too ashamed to tell his name.

From the Very blue Massachusetts
Sherpa Doug
Guest








addenda
PostPosted: Tue Dec 21, 2004 2:14 am     Reply with quote

pic receive pulse from sensor
with this pulse i want define two parameters:
- instant value
-globally value of flow
i need one pic who see over 65536 pulse (ex: 99999) on lcd display
procos



Joined: 15 Dec 2004
Posts: 12

View user's profile Send private message

my
PostPosted: Tue Dec 21, 2004 2:20 am     Reply with quote

Exclamation
Very Happy Wink
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Dec 21, 2004 8:31 am     Reply with quote

Just have a 16 bit, or even 8 bit counter counting pulses. The main software loop occasionally looks at the counter to see if it has overflowed and if so increments another software counter. You can have as many bits as you have RAM to spare.

In pseudocode:

Code:

MSB  MSB of hardawre counter
short HC = 0;   HalfCarry flag shows that we have seen MSB high

if (MSB == 1)
    HC = 1;
if ((MSB == 0)) && (HC == 1)){  //Only true the FIRST time after MSB goes to 0
    HC = 0;
    SoftwareCounter++;
    }

_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group