- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Post your project and forum can take a look at it -
“File” Designer
“Archive Project”
Use Firefox or IE, not chrome to post.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Thank you for your comments
I tried to modify the program you attached:
1. I replaced the LCD with UART
2. Changed period for counter to 2,000,000
3. Changed clock for timers to 210kHz instead of 200kHz (reserved VC3 for UART)
I tested an external 32.768 kHz signal; the program works but results were incorrect "project is attached"
Also, I noticed that results changed when delay is added
Is there any way to increase precision of measurements? (i.e. 32786.324342 Hz)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The forum thread you point to in your initial post is a (nearly) ten year old thread, when there have been issues with the timer or counter component so far they will have been corrected.
Increasing the precision of frequency measurement mainly needs a more precise clock. In the case of PSoC1 it means a quarz generating the needed main frequencies, so with your initial solution you are on the right track.
When you cannot get your 24-bit component to work (and I am very sure that it works correctly) you might have something gone amiss. use Designer -> File -> Archive Project and then attach the resulting file, so that we all can have a brief look at. DO NOT use chrome there is a bug with the forum software. Use internet explorer or firefox instead
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ref material I attached earlier discusses in depth errors and accuracy
in various freq cntr methods.
In short the accuracy of the measurement primarily dictated by gate accuracy.
If you are deriving gate from internal PSOC CPU clock then from datasheet its
accuracy shown below. If you want more accuracy then CPU clock/gate must
come from external precision oscillator. It then controls accuracy/drift.
What accuracy and rersolution and range of frequency measurement do you
want ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My project is attached, I replaced the design of a Timer16 (perfectly working) with a Timer24, this program (after adding Timer24) returns random numbers!
*Commetned lines are previous implementation using Timer16
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your progect did not get attached. Use ms internet explorer to post, switch on compatibility mode.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The approach you take vs the one I supplied has the following issues -
1) To maximize freq measuring range you load 24 bit counter or timer with
its max 24 bit value, 16,777,215. Gate starts timer/counter counting down,
and when gate goes low timer/counter stopped. In case of cntr thats a direct
connection from gate to cntr enable. In case of timer thats a SW method.
When you grab timer/counter value, subtract that from 16,777,215 and that
is the number of counts/Hz (if gate high = 1 sec).
2) The use of counter vs timer yields a +/- 1 count error in measurement, whereas
use of a timer has more SW slop in it, affected by ISRs, etc..
3) Period of gate unimportent, its high time when counter/timer allowed to count
that matters. So if high time = 1 sec, then count value from counter reads out in
Hz.
In short I think cntr based solution more precise because of its enable pin being
tied directly to gate.
Because the gate is derived from internal PSOC clock that has several % inaccuracy,
so your readings will reflect this.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your comments
The design (example you posted) works now, but I have some questions:
1. Is it possible, in this design, to clock the counter24 directly by external oscillator without setting it up as external main oscillator?
2. Is there any chance to get more accurate results? (more digits 32768.42342 Hz instead of 32768 Hz)
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Is it possible, in this design, to clock the counter24 directly by external oscillator without setting it up as external main oscillator?
Not sure what you mean by this. The counter input is external unknown frequency to measure.
So not sure what you are asking.
2. Is there any chance to get more accurate results? (more digits 32768.42342 Hz instead of 32768 Hz)
What you are asking is to measure .00001 part in 32768 which equals .0003 ppm which is better than
most atomic clocks. That would have to be the resolution of the gate signal, which would have to come
from an external source. The reference material I supplied allows you to make these calculations.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I mean that I want to measure unknown frequency using external oscillator source to get higher precision
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you are asking is to measure .00001 part in 32768 which equals .0003 ppm which is better than
most atomic clocks.
Then simply make the calculations for error, temp, etc.. and look at cost consequences.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tnank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One possibility to investigate, low cost, is GPS derived gate for the counter.
Regards, Dana.