View previous topic :: View next topic |
Author |
Message |
procos
Joined: 15 Dec 2004 Posts: 12
|
answare pls ? |
Posted: Mon Dec 20, 2004 5:32 am |
|
|
i can count puls over 65536 with PIC ?
wath PIC ? |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon Dec 20, 2004 5:54 am |
|
|
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
|
|
Posted: Mon Dec 20, 2004 7:51 am |
|
|
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
|
|
Posted: Mon Dec 20, 2004 1:00 pm |
|
|
SherpaDoug wrote: | Don't blame me I'm from a blue state |
Thank God for red states.... |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Dec 20, 2004 1:23 pm |
|
|
Anonymous wrote: | SherpaDoug wrote: | Don't blame me I'm from a blue state |
Thank God for red states.... |
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 |
Posted: Tue Dec 21, 2004 2:14 am |
|
|
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
|
my |
Posted: Tue Dec 21, 2004 2:20 am |
|
|
|
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Dec 21, 2004 8:31 am |
|
|
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. |
|
|
|