For some reason I am not getting the individual emails so I apologize for not replying more promptly. I’ll have to check my profile.
As far as I can tell from the notes, and by the way, the number of notes was why I was trying to move this off list, to get to .001hz I need to measure over 1000 seconds. This is ok. Since I am looking for an average over time anyway, this is not a problem. By the way I am using a GPSDO and planned to use it divided down for the gate.
The only reason I mentioned a prescaler was that there was a 12 digit counter schematic on the web that looked pretty complete. This person used a prescaler and I was trying to wrap my head around how this helped with resolution and I guess from the replies, that is not a practical solution (using a prescaler) when you want high resolution unless I use the inverse operation which I can’t remember what it is called off the top of my head.
I’ve seen some HP 12 digit counters but since I have a GPSDO and who knows how many micro development boards around here, I thought I would take a run at it.
So to summarize, if I limit my high resolution to 99,999,999.999hz and use a gate of 1000 seconds, would that get me to .01hz? If not, then what would the possible resolution be?
Thanks for all the input, very helpful.
Jerry
Reciprocal counter where one measures the period of the output of a divide by N and then takes the reciprocal of this period multiplied by N as the frequency of the divider input. With a 100MHz clock one can achieve ~ 0.01ppm resolution for a 1 second averaging time. if one uses interpolators with 100ps resolution (equivalent to a 10GHz clock) the resolution improves to ~0.1ppb for a 1s averaging time.
Bruce
On 24 April 2017 at 13:25 Jerry Hancock <jerry@hanler.com> wrote:
For some reason I am not getting the individual emails so I apologize for not replying more promptly. I’ll have to check my profile.
As far as I can tell from the notes, and by the way, the number of notes was why I was trying to move this off list, to get to .001hz I need to measure over 1000 seconds. This is ok. Since I am looking for an average over time anyway, this is not a problem. By the way I am using a GPSDO and planned to use it divided down for the gate.
The only reason I mentioned a prescaler was that there was a 12 digit counter schematic on the web that looked pretty complete. This person used a prescaler and I was trying to wrap my head around how this helped with resolution and I guess from the replies, that is not a practical solution (using a prescaler) when you want high resolution unless I use the inverse operation which I can’t remember what it is called off the top of my head.
I’ve seen some HP 12 digit counters but since I have a GPSDO and who knows how many micro development boards around here, I thought I would take a run at it.
So to summarize, if I limit my high resolution to 99,999,999.999hz and use a gate of 1000 seconds, would that get me to .01hz? If not, then what would the possible resolution be?
Thanks for all the input, very helpful.
Jerry
_______________________________________________
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
Jerry, for a 100MHz PIC based counter a prescaler will be necessary. But it will not be necessary for a 30MHz counter.
Prescalers do not have to be by divisors of 10. I recall the PIC counter input to be good to 50MHz so the prescaler could just be a divide by two if you need a 100MHz counter and it has to be done by a PIC.
Of course there are lots of logic families that don't need a prescaler at 100MHz and could be used to make a frequency counter.
Most frequency counter designs out there on the net introduce an extra count or two due to flawed conception of gate.
Tim N3QE
Sent from my VAX-11/780
On Apr 23, 2017, at 9:25 PM, Jerry Hancock jerry@hanler.com wrote:
For some reason I am not getting the individual emails so I apologize for not replying more promptly. I’ll have to check my profile.
As far as I can tell from the notes, and by the way, the number of notes was why I was trying to move this off list, to get to .001hz I need to measure over 1000 seconds. This is ok. Since I am looking for an average over time anyway, this is not a problem. By the way I am using a GPSDO and planned to use it divided down for the gate.
The only reason I mentioned a prescaler was that there was a 12 digit counter schematic on the web that looked pretty complete. This person used a prescaler and I was trying to wrap my head around how this helped with resolution and I guess from the replies, that is not a practical solution (using a prescaler) when you want high resolution unless I use the inverse operation which I can’t remember what it is called off the top of my head.
I’ve seen some HP 12 digit counters but since I have a GPSDO and who knows how many micro development boards around here, I thought I would take a run at it.
So to summarize, if I limit my high resolution to 99,999,999.999hz and use a gate of 1000 seconds, would that get me to .01hz? If not, then what would the possible resolution be?
Thanks for all the input, very helpful.
Jerry
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
Hi
Let’s back off a bit.
To most of us, a 12 digit counter displays 12 digits regardless of the frequency
you put into it. That’s been the way good bench counters have done it since
the early 1970’s. Typically the number of digits is specified at a one second
gate time. An HP 5335 is one example. It is called a 9 digit (or more properly
9 digit per second) counter. Over the last 30 years, the last “per second” part
has commonly been dropped.
In the world of computers, the number of digits displayed is not the big deal
it was back in the days of nixie tubes. As Chris points out, comping up a display
is what things like the F7 are intended to do. The Discovery boards are a
cheap way to get this running.
Thus the confusion.
If you prescale you divide down the input frequency. The counter is “reading”
the divided down frequency. That’s not a big deal on a modern counter. It is
a big deal on an old style counter On an old style counter, you don’t get a
constant number of digits at a given gate time. If you put in 1,000 cycles (also
called Hertz ..) and count them for one second, there will be four digits displayed.
If you prescale the signal by 100, your counter will display 10 (two digits displayed).
In general prescalers are something to avoid on an old style counter.
With a modern 9 digit counter, if you put in 1,000 Hz and ran for a second you would
get 1,000.123456 on the display. You might or might not get good accuracy in
all those digits. That’s roughly what the display would look like.
So now back to the real questions:
What is your input signal? How high is it in frequency? Is there a range of frequencies?
Is it modulated? …..
What kind of accuracy are you after? (resolution and accuracy are two different things).
Is this a learning experience? Would a purchased counter for < $100 be an equally good
answer?
Is the count it’s self significant? There are many different ways to measure frequency
other than a straight counter.
Lots of fun.
Bob
On Apr 23, 2017, at 9:25 PM, Jerry Hancock jerry@hanler.com wrote:
For some reason I am not getting the individual emails so I apologize for not replying more promptly. I’ll have to check my profile.
As far as I can tell from the notes, and by the way, the number of notes was why I was trying to move this off list, to get to .001hz I need to measure over 1000 seconds. This is ok. Since I am looking for an average over time anyway, this is not a problem. By the way I am using a GPSDO and planned to use it divided down for the gate.
The only reason I mentioned a prescaler was that there was a 12 digit counter schematic on the web that looked pretty complete. This person used a prescaler and I was trying to wrap my head around how this helped with resolution and I guess from the replies, that is not a practical solution (using a prescaler) when you want high resolution unless I use the inverse operation which I can’t remember what it is called off the top of my head.
I’ve seen some HP 12 digit counters but since I have a GPSDO and who knows how many micro development boards around here, I thought I would take a run at it.
So to summarize, if I limit my high resolution to 99,999,999.999hz and use a gate of 1000 seconds, would that get me to .01hz? If not, then what would the possible resolution be?
Thanks for all the input, very helpful.
Jerry
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
On Sun, Apr 23, 2017 at 6:25 PM, Jerry Hancock jerry@hanler.com wrote:
So to summarize, if I limit my high resolution to 99,999,999.999hz and use
a gate of 1000 seconds, would that get me to .01hz? If not, then what
would the possible resolution be?
It is best to keep this kind of discussion on the list. That way if some
one like me sys something dumb, it will get noticed and called out.
OK, so it seems you
(1) are interested in measuring frequency up to 100 MHz but no higher.
(2) want to use an STM32 ARM uP to
(3) Are using the older (and simpler) design that simply counts cycles and
divides by the gate time to measure frequency
If the above assumptions are wrong. STOP reading now and post corrections
or additions
OK so we are good to go....
I assume you know about and intend to use the built in counter/timmer on
the STM32. You first step is to find out the maximum pule rate you can
place on that pin. Lets guess it is 48 MHz. But you are a conservative
engineer an want to de-rate it to 24 MHz.
This means to measure up to 100 MHz you will need a prescaler that can
divide by 4. This will transform you maximum 100 MHz to a maximum of 25
MHz. It will force you into using 4X longer gate time. This is the only
reason to pre-scale, because you can't otherwise process the signal.
Now it is very simple. You write software that starts the counters on the
desired pin and then your GPS sends a signal every one second (You do NOT
need to divide down the 10MHZ from a GPSDO because the GPS already has a
one pulse per second output that feeds the DO.) SO every one second you
read the number of counts and keep doing this for as many seconds as you
need After the gate time which might be one second or 4,000 seconds you
add up all the one second readings and compute the answer.
Actually you can do better given the excess computer power you have: You
can output a frequency estimate after the first send and then each second
you can output a more accurate value until finally after 4,000 seconds out
have 0.001 Hz. So in the first second you put up a display that is good
for +/- 4 hZ and then four seconds later you can be a 1.0 Hz and after an
hour 0.001 Hz
As I wrote before. I use the "trigger" output of my old Tektronix scope
as input to my counter because the scopes trigger is MUCH better. If you
own a 'scope this will save you a LOT of work as all you would need to
build is a voltage converter to take the trigger output to 3v3 volts for
the STM32. The STM already can do rescaling and counting. Connect an
I2C display and you are done with the hardware. For a better and cheaper
display, the STM32 can serve a web page and then you see the frequency on
your phone.
Chris Albertson
Redondo Beach, California
Hi
Some of the process below is “not trivial”. One example:
You have a “gate” from the GPSDO and a “signal” from somewhere else. If you
want the STM to do the whole thing, the “gate” pin needs to get the job done in
X +/- 1 cycles of the “signal” pin. Delay X (if it’s consistent) isn’t a problem. Having a
+/- 1 cycle delay is a problem. The interrupt servicing structure in the MCU
may or may not be able to hit things +/- 10 ns or even +/- 100 ns. Sometimes a
“lower power” MCU with simple code is better at this than a multi core gizmo running
a high level operating system.
Lots of things to dig into.
Bob
On Apr 24, 2017, at 12:45 PM, Chris Albertson albertson.chris@gmail.com wrote:
On Sun, Apr 23, 2017 at 6:25 PM, Jerry Hancock jerry@hanler.com wrote:
So to summarize, if I limit my high resolution to 99,999,999.999hz and use
a gate of 1000 seconds, would that get me to .01hz? If not, then what
would the possible resolution be?
It is best to keep this kind of discussion on the list. That way if some
one like me sys something dumb, it will get noticed and called out.
OK, so it seems you
(1) are interested in measuring frequency up to 100 MHz but no higher.
(2) want to use an STM32 ARM uP to
(3) Are using the older (and simpler) design that simply counts cycles and
divides by the gate time to measure frequency
If the above assumptions are wrong. STOP reading now and post corrections
or additions
OK so we are good to go....
I assume you know about and intend to use the built in counter/timmer on
the STM32. You first step is to find out the maximum pule rate you can
place on that pin. Lets guess it is 48 MHz. But you are a conservative
engineer an want to de-rate it to 24 MHz.
This means to measure up to 100 MHz you will need a prescaler that can
divide by 4. This will transform you maximum 100 MHz to a maximum of 25
MHz. It will force you into using 4X longer gate time. This is the only
reason to pre-scale, because you can't otherwise process the signal.
Now it is very simple. You write software that starts the counters on the
desired pin and then your GPS sends a signal every one second (You do NOT
need to divide down the 10MHZ from a GPSDO because the GPS already has a
one pulse per second output that feeds the DO.) SO every one second you
read the number of counts and keep doing this for as many seconds as you
need After the gate time which might be one second or 4,000 seconds you
add up all the one second readings and compute the answer.
Actually you can do better given the excess computer power you have: You
can output a frequency estimate after the first send and then each second
you can output a more accurate value until finally after 4,000 seconds out
have 0.001 Hz. So in the first second you put up a display that is good
for +/- 4 hZ and then four seconds later you can be a 1.0 Hz and after an
hour 0.001 Hz
As I wrote before. I use the "trigger" output of my old Tektronix scope
as input to my counter because the scopes trigger is MUCH better. If you
own a 'scope this will save you a LOT of work as all you would need to
build is a voltage converter to take the trigger output to 3v3 volts for
the STM32. The STM already can do rescaling and counting. Connect an
I2C display and you are done with the hardware. For a better and cheaper
display, the STM32 can serve a web page and then you see the frequency on
your phone.
Chris Albertson
Redondo Beach, California
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
On Mon, Apr 24, 2017 at 10:13 AM, Bob kb8tq kb8tq@n1k.org wrote:
Hi
Some of the process below is “not trivial”. One example:
You have a “gate” from the GPSDO and a “signal” from somewhere else. If you
want the STM to do the whole thing, the “gate” pin needs to get the job
done in
X +/- 1 cycles of the “signal” pin. Delay X (if it’s consistent) isn’t a
problem. Having a
+/- 1 cycle delay is a problem. The interrupt servicing structure in
the MCU
may or may not be able to hit things +/- 10 ns or even +/- 100 ns.
Sometimes a
“lower power” MCU with simple code is better at this than a multi core
gizmo running
a high level operating system.
--
C
The STM32 is in fact a low level micro controller that does not run an OS.
The chips contain counters and other hardware so most of the real-time
stuff is not done in software. You need to set this up so the on-chip
hardware outside of the CPU is used.
There are two basic types of ARM computers, the "Cortex A" is what is in
your phone and these have multi cores, GHz class clock speeds, gigabytes
class memories and run an OS. The other is ARM "Cortex M". These are
much smaller and run on about 100 uA of current with clocks about 100 MHz
and kilobyte class memories and don't support running an OS. These are
used in embedded applications such as the throttle control in your car or a
high end battery charger. These cost about $1 each and the physical chip
is about 3/8 inches square. I buy them quality one as a "Nucleo" board
for about $12. It is like an Arduino but about (literally) 100X better
specs and half the cost. About the same physical size. But for this
counter project I'd use a generic STM32 board from eBay. They sell for
about $2 shipped
Take a look at this device. It has a lot of power. It can even be
programmed using the Arduino IDE or the gnu toolchain and others. You
can't beat the price or the size.
...ebay.com/itm/New-STM32F103C8T6-ARM-STM32...
http://www.ebay.com/itm/New-STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino-/272546586490?hash=item3f750adf7a:g:RakAAOSwUKxYlyHv
hris Albertson
Redondo Beach, California
Hi
On Apr 24, 2017, at 3:49 PM, Chris Albertson albertson.chris@gmail.com wrote:
On Mon, Apr 24, 2017 at 10:13 AM, Bob kb8tq kb8tq@n1k.org wrote:
Hi
Some of the process below is “not trivial”. One example:
You have a “gate” from the GPSDO and a “signal” from somewhere else. If you
want the STM to do the whole thing, the “gate” pin needs to get the job
done in
X +/- 1 cycles of the “signal” pin. Delay X (if it’s consistent) isn’t a
problem. Having a
+/- 1 cycle delay is a problem. The interrupt servicing structure in
the MCU
may or may not be able to hit things +/- 10 ns or even +/- 100 ns.
Sometimes a
“lower power” MCU with simple code is better at this than a multi core
gizmo running
a high level operating system.
--
C
The STM32 is in fact a low level micro controller that does not run an OS.
The STM being discussed is what they call an F7 part. A representative
board running it is (= the one here on my desk):
http://www.st.com/en/evaluation-tools/32f769idiscovery.html http://www.st.com/en/evaluation-tools/32f769idiscovery.html
It’s a board with 128 Mb of RAM and 512 Mb of flash. Among the other stuff on
there is an RJ-45 ethernet jack There are a variety of RTOS options available
along with some cut down Linux versions. Trying to do ethernet without at least
an RTOS does not make much sense. It’s what they are calling an Cortex-M7 rather than
a Cortex M4. There are a number of similar boards. If it’s an STM 32F7, the features
on the board will be similar to the one sitting here.
Indeed the term STM32 covers a lot of ground and we have zigged and zagged
a bit. Repeating all of the details from every earlier post in the thread makes
things even longer than they already are. Some amount of abbreviation is
inevitable.
Bob
The chips contain counters and other hardware so most of the real-time
stuff is not done in software. You need to set this up so the on-chip
hardware outside of the CPU is used.
There are two basic types of ARM computers, the "Cortex A" is what is in
your phone and these have multi cores, GHz class clock speeds, gigabytes
class memories and run an OS. The other is ARM "Cortex M". These are
much smaller and run on about 100 uA of current with clocks about 100 MHz
and kilobyte class memories and don't support running an OS. These are
used in embedded applications such as the throttle control in your car or a
high end battery charger. These cost about $1 each and the physical chip
is about 3/8 inches square. I buy them quality one as a "Nucleo" board
for about $12. It is like an Arduino but about (literally) 100X better
specs and half the cost. About the same physical size. But for this
counter project I'd use a generic STM32 board from eBay. They sell for
about $2 shipped
Take a look at this device. It has a lot of power. It can even be
programmed using the Arduino IDE or the gnu toolchain and others. You
can't beat the price or the size.
...ebay.com/itm/New-STM32F103C8T6-ARM-STM32...
http://www.ebay.com/itm/New-STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino-/272546586490?hash=item3f750adf7a:g:RakAAOSwUKxYlyHv
hris Albertson
Redondo Beach, California
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
Bob, I have an STM32F769 disco as well as the Nucleo version. The big difference between the two is the LCD display on the Disco from what I remember.
I’ll play around with the code this week and report back.