Accurate timing... without timer? [Query]
I have a working project for an audio·frequency counter·completed using an ATMEL AVR but it got me thinking about using an SX28 for the same thing just to see how it could be done.· On the AVR, I made use of the timer interrupt and the ·"counter" mode of the on-chip timers.· Looking at the SX28, I see that the timer absent from the list of features.
If I use a high speed resonator and instead of interrupts·use software delay loops can I count on having reasonably accurate results (to a point)?· I mean accurately enough for say a 20MHZ Frequency Counter.·
I did Google first but frequency counting with SX28·seems to have very·few if any good·examples.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
If I use a high speed resonator and instead of interrupts·use software delay loops can I count on having reasonably accurate results (to a point)?· I mean accurately enough for say a 20MHZ Frequency Counter.·
I did Google first but frequency counting with SX28·seems to have very·few if any good·examples.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
Comments
I think it's going to be pretty hard to get accurate timing u to 20 MHz using a chip running at 50 MHz. Even if you push the SX to 75 MHz, you still don't have a lot of CPU cycles between incoming pulses. At 50 MHz, you have 2.5 CPU cycles between incoming pulses, and at 75 MHz, you have 3.75. I don't see how a software solution is going to work here.
Thanks,
PeterM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
I think humans can hear to around 20KHz, dogs up around 50KHz and bats clear up to 100Khz or so. Do you really need an audio frequency counter that goes clear up to 20MHz?
Just wondering.
- Sparks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
Understood. Still, to expect the SX to handle frequencies 1000 times higher than the Atmel chip is kind of over the top. Ten times? Sure. 100? Maybe? 1000? Now you're just being greedy. BTW, I'm just busting your chops when I say that.
Your task is probably a good job for an FPGA with a really fast clock.
Thanks,
PeterM
· Actually I have just recently been working on a similar project.
· By using the RTCC input with prescaler I was able to count up to 50MHz while running the SX at only 5 MHz.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My goal is to live forever...Or die trying.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
Post Edited (Bean (Hitt Consulting)) : 10/4/2007 1:38:08 PM GMT
I was so dead set on looking to replicate my method used with the AVR that I wasn't looking into any other possibilities...
Awesome as always Bean!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
I do not understand English.
I write this with an interpreter.
Please allow for a sentence to be strange.
I use "20MHZxtal" for the next place and measure "50MHZ".
What does XS do that I am particular about this use for?
http://www5b.biglobe.ne.jp/~YASUSI/gallery/electronics/061104/061104.htm
The SX48 16-bit timers don't work the same way. You can only measure up to 1/2 the clock frequency EVEN WITH the prescalers.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
The frequency AFTER the prescaler must be less than 1/2 of the SX clock frequency.
50.0/8 = 6.25MHz
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
The next part cannot understand me.
Can you measure a clock of SX to 160MHZ at the time of 20MHZ? .
The circuit where I took for an example inputs 20MHz into CLKin and inputs it into RA3,RA4 through resistance.
By a method to send a prescaler and a timer, I decide the most suitable number of partitions I measure frequency in first time, and to be next.
How much does the best measurement upper limit frequency of such a method become?
nonnno
Can you elaborate why the 16-bit multi-use timers won't do the job while the RTCC can?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······
When using the RTCC input the OUTPUT of the prescaler must be less than half of the SX clock, but when using the SX48 timers the INPUT to the prescalers must be less than half the SX clock.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······
Because I was able to obtain "SX28AC/SS" several, I looked for a document.
I wandered in web and found here and found words of "Bean.".
I still touch it in "SX", and there is hardly knowledge at the start.
(Data of the greatest input frequency of RTCC are short.)
According to the data sheet which the microchip of the contents which I examined gives, it is next. It "is FIGURE 17-8:00" "PIC16F627A/628A/648A Data Sheet" "16F648A" "p146" The best frequency is 50MHZ by TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS "42=20ns" this.
I look for a similar document in this.
When I take the clock source of "SX28AC/SS" not XTAL outside, it is written 50MHZ or 75MHZ and does not become clear which it is.
I am sad if a prescaler acts on only 1/2, 37.5MHz of the clock source if it is 75MHZ.
nonnno