Hi
There are a number of us on the list who code on ARM MCU’s. Doing the
same thing on one of them is not a trivial undertaking. Making sure that
it does what it should simply is not worth the effort. The PIC 12 is a low cost
solution and has been extensively tested to show that it does what it should
under a range of conditions ….
Bob
On Nov 17, 2016, at 4:26 PM, Bryan _ bpl521@outlook.com wrote:
Tom:
As you were gracious to release the source code for these excellent little dividers, I would suspect someone who is somewhat fluent in assembly could just modify so it counts a specific number of pulses and then toggles a output off. The ARM could be used to restart etc. Although I think the OP wanted to know the time taken between a run of a number of cycles.
Been playing around with the PD15 to replace 2 -14 pin clock dividers and it seems to work like a charm, although I can't seem to find any information if the inputs on a 12F675 are Schmitt trigger inputs. Can't seem to find anything in the datasheet.
-=Bryan=-
From: time-nuts time-nuts-bounces@febo.com on behalf of Tom Van Baak tvb@LeapSecond.com
Sent: November 16, 2016 3:27 PM
To: Discussion of precise time and frequency measurement
Subject: Re: [time-nuts] precision timing pulse
Chris & Chris,
Yes the "TVB dividers" are instruction loops where every cycle is counted by hand, and then verified with a simulator, and then checked with a time interval counter. All the code is out there at www.leapsecond.com/pic/http://www.leapsecond.com/pic/
I use PIC's for historical and technical reasons. Modern CPU's and MCU's have so many layers of optimization that they are no longer deterministic at the cycle level. This makes them worthless for precise time applications. In addition many of them use clock edge or PLL tricks to increase speed, but this introduces jitter. Or they enable interrupts which kills precise timing. The PIC's are old-school, fully synchronous and use only one clock edge so the jitter is down at the picosecond level. My code is isochronous and doesn't use interrupts for timing. It acts like a poor man's FPGA.
Arduino probably uses compiled code, external libraries, and interrupts so that also is a no-no for precise time. I'm not sure about bare metal AVR. I hope someone can do measurements on an AVR divider one day so we can compare PIC and AVR jitter. I worry about how AVR implements the clock. So this is an open question. But I know how PIC's work so that's what I use. BTW, these are "ancient" PIC 12F parts. It's possible modern 16- and 32-bit PIC's also go to the dark side and optimize for performance rather than picosecond determinism. Another open question.
Realize that using a MCU for a frequency divider is a weird niche use of the chip, so none of what I say applies if you plan to use any of these as a general purpose computing system.
Also, we don't know if OP is looking for microsecond, nanosecond, or picosecond precision in his timing pulses.
/tvb
Chris Albertson:
I'm wondering why everyone seems to be assuming a PIC is the right
processor. Of course it could work for this but I'd select whatever is
the easiest to program and debug. Those tend to the they little single
board development systems that sell for under $10. They typically have USB
connections to a computer and don't require any specialized equipment to
program. The Arduino is the prime example of these although I've moved to
ARM based uP because they can be less expensive with an order of magnitude
better performance and can use the same Arduino IDE and run Arduino
sketches. The PIC is not so beginner friendly and requires some study
before it can be used. But if you as said of course a PIC could work,
this is a pretty simple application
Chris Caudle:
You could use AVR (arduino), but once you get to most of the ARM
processors it is harder to make them deterministic because of caches. You
want a processor where the number of clocks is constant for all or almost
all instructions, and is easy enough that you can code the loops by hand.
Code like TVB's divider probably doesn't even use interrupts, it's just a
tight loop where the number of instructions is counted to give the
behavior wanted.
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
time-nuts Info Page - American Febo Enterpriseshttps://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
www.febo.com
time-nuts is a low volume, high SNR list for the discussion of precise time and frequency measurement and related topics. To see the collection of prior postings to ...
and follow the instructions there.
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.
If the OP would contact me I would be happy to make a new PIC divider for his specific purpose. I do this all the time. It usually only takes a few minutes.
On the PIC 12F675, pin5 / GP2 is Schmitt trigger. See page 8 of 41190F-PIC-12F629-675.pdf
But for push-button-start sorts of things input conditioning is unnecessary. It's only when a button is both start and stop or increment or decrement that you need to debounce and all that stuff.
/tvb
----- Original Message -----
From: "Bryan _" bpl521@outlook.com
To: "Discussion of precise time and frequency measurement" time-nuts@febo.com
Sent: Thursday, November 17, 2016 1:26 PM
Subject: Re: [time-nuts] precision timing pulse
Tom:
As you were gracious to release the source code for these excellent little dividers, I would suspect someone who is somewhat fluent in assembly could just modify so it counts a specific number of pulses and then toggles a output off. The ARM could be used to restart etc. Although I think the OP wanted to know the time taken between a run of a number of cycles.
Been playing around with the PD15 to replace 2 -14 pin clock dividers and it seems to work like a charm, although I can't seem to find any information if the inputs on a 12F675 are Schmitt trigger inputs. Can't seem to find anything in the datasheet.
-=Bryan=-
Sorry, meant the ARM pin on the picdiv not the ARM MCU's
-=Bryan=-
From: time-nuts time-nuts-bounces@febo.com on behalf of Bob Camp kb8tq@n1k.org
Sent: November 17, 2016 2:07 PM
To: Discussion of precise time and frequency measurement
Subject: Re: [time-nuts] precision timing pulse
Hi
There are a number of us on the list who code on ARM MCU’s. Doing the
same thing on one of them is not a trivial undertaking. Making sure that
it does what it should simply is not worth the effort. The PIC 12 is a low cost
solution and has been extensively tested to show that it does what it should
under a range of conditions ….
Bob
On Nov 17, 2016, at 4:26 PM, Bryan _ bpl521@outlook.com wrote:
Tom:
As you were gracious to release the source code for these excellent little dividers, I would suspect someone who is somewhat fluent in assembly could just modify so it counts a specific number of pulses and then toggles a output off. The ARM could be used to restart etc. Although I think the OP wanted to know the time taken between a run of a number of cycles.
Been playing around with the PD15 to replace 2 -14 pin clock dividers and it seems to work like a charm, although I can't seem to find any information if the inputs on a 12F675 are Schmitt trigger inputs. Can't seem to find anything in the datasheet.
-=Bryan=-
From: time-nuts time-nuts-bounces@febo.com on behalf of Tom Van Baak tvb@LeapSecond.com
Sent: November 16, 2016 3:27 PM
To: Discussion of precise time and frequency measurement
Subject: Re: [time-nuts] precision timing pulse
Chris & Chris,
Yes the "TVB dividers" are instruction loops where every cycle is counted by hand, and then verified with a simulator, and then checked with a time interval counter. All the code is out there at www.leapsecond.com/pic/<http://www.leapsecond.com/pic/<http://www.leapsecond.com/pic/http://www.leapsecond.com/pic/>
I use PIC's for historical and technical reasons. Modern CPU's and MCU's have so many layers of optimization that they are no longer deterministic at the cycle level. This makes them worthless for precise time applications. In addition many of them use clock edge or PLL tricks to increase speed, but this introduces jitter. Or they enable interrupts which kills precise timing. The PIC's are old-school, fully synchronous and use only one clock edge so the jitter is down at the picosecond level. My code is isochronous and doesn't use interrupts for timing. It acts like a poor man's FPGA.
Arduino probably uses compiled code, external libraries, and interrupts so that also is a no-no for precise time. I'm not sure about bare metal AVR. I hope someone can do measurements on an AVR divider one day so we can compare PIC and AVR jitter. I worry about how AVR implements the clock. So this is an open question. But I know how PIC's work so that's what I use. BTW, these are "ancient" PIC 12F parts. It's possible modern 16- and 32-bit PIC's also go to the dark side and optimize for performance rather than picosecond determinism. Another open question.
Realize that using a MCU for a frequency divider is a weird niche use of the chip, so none of what I say applies if you plan to use any of these as a general purpose computing system.
Also, we don't know if OP is looking for microsecond, nanosecond, or picosecond precision in his timing pulses.
/tvb
Chris Albertson:
I'm wondering why everyone seems to be assuming a PIC is the right
processor. Of course it could work for this but I'd select whatever is
the easiest to program and debug. Those tend to the they little single
board development systems that sell for under $10. They typically have USB
connections to a computer and don't require any specialized equipment to
program. The Arduino is the prime example of these although I've moved to
ARM based uP because they can be less expensive with an order of magnitude
better performance and can use the same Arduino IDE and run Arduino
sketches. The PIC is not so beginner friendly and requires some study
before it can be used. But if you as said of course a PIC could work,
this is a pretty simple application
Chris Caudle:
You could use AVR (arduino), but once you get to most of the ARM
processors it is harder to make them deterministic because of caches. You
want a processor where the number of clocks is constant for all or almost
all instructions, and is easy enough that you can code the loops by hand.
Code like TVB's divider probably doesn't even use interrupts, it's just a
tight loop where the number of instructions is counted to give the
behavior wanted.
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
time-nuts Info Page - American Febo Enterpriseshttps://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
www.febo.com
time-nuts is a low volume, high SNR list for the discussion of precise time and frequency measurement and related topics. To see the collection of prior postings to ...
time-nuts Info Page - American Febo Enterpriseshttps://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
www.febo.comhttp://www.febo.com
time-nuts is a low volume, high SNR list for the discussion of precise time and frequency measurement and related topics. To see the collection of prior postings to ...
and follow the instructions there.
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.
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.
Tom describes the PIC as a 'poor man's FPGA'. And I'm aware of how they're
programmed - I agree they're a good choice for this sort of device.
However, even poor men can use FPGAs now. I'm following with interest the
open-source toolchain available for the Lattice ice40,
http://www.clifford.at/icestorm/
There are, of course, other cheap FPGAs and free-to-use vendor tools. I've
always found the vendor tools horrendous, with huge overheads and
complicated licensing, so something a bit more manageable is attractive.
On Thu, Nov 17, 2016 at 10:07 PM, Bob Camp kb8tq@n1k.org wrote:
Hi
There are a number of us on the list who code on ARM MCU’s. Doing the
same thing on one of them is not a trivial undertaking. Making sure that
it does what it should simply is not worth the effort. The PIC 12 is a low
cost
solution and has been extensively tested to show that it does what it
should
under a range of conditions ….
Bob
On Nov 17, 2016, at 4:26 PM, Bryan _ bpl521@outlook.com wrote:
Tom:
As you were gracious to release the source code for these excellent
little dividers, I would suspect someone who is somewhat fluent in assembly
could just modify so it counts a specific number of pulses and then toggles
a output off. The ARM could be used to restart etc. Although I think the OP
wanted to know the time taken between a run of a number of cycles.
Been playing around with the PD15 to replace 2 -14 pin clock dividers
and it seems to work like a charm, although I can't seem to find any
information if the inputs on a 12F675 are Schmitt trigger inputs. Can't
seem to find anything in the datasheet.
Sent: November 16, 2016 3:27 PM
To: Discussion of precise time and frequency measurement
Subject: Re: [time-nuts] precision timing pulse
Chris & Chris,
Yes the "TVB dividers" are instruction loops where every cycle is
counted by hand, and then verified with a simulator, and then checked with
a time interval counter. All the code is out there at
www.leapsecond.com/pic/http://www.leapsecond.com/pic/
I use PIC's for historical and technical reasons. Modern CPU's and MCU's
have so many layers of optimization that they are no longer deterministic
at the cycle level. This makes them worthless for precise time
applications. In addition many of them use clock edge or PLL tricks to
increase speed, but this introduces jitter. Or they enable interrupts which
kills precise timing. The PIC's are old-school, fully synchronous and use
only one clock edge so the jitter is down at the picosecond level. My code
is isochronous and doesn't use interrupts for timing. It acts like a poor
man's FPGA.
Arduino probably uses compiled code, external libraries, and interrupts
so that also is a no-no for precise time. I'm not sure about bare metal
AVR. I hope someone can do measurements on an AVR divider one day so we can
compare PIC and AVR jitter. I worry about how AVR implements the clock. So
this is an open question. But I know how PIC's work so that's what I use.
BTW, these are "ancient" PIC 12F parts. It's possible modern 16- and 32-bit
PIC's also go to the dark side and optimize for performance rather than
picosecond determinism. Another open question.
Realize that using a MCU for a frequency divider is a weird niche use of
the chip, so none of what I say applies if you plan to use any of these as
a general purpose computing system.
Also, we don't know if OP is looking for microsecond, nanosecond, or
picosecond precision in his timing pulses.
/tvb
Chris Albertson:
I'm wondering why everyone seems to be assuming a PIC is the right
processor. Of course it could work for this but I'd select whatever is
the easiest to program and debug. Those tend to the they little single
board development systems that sell for under $10. They typically have
USB
connections to a computer and don't require any specialized equipment to
program. The Arduino is the prime example of these although I've
moved to
ARM based uP because they can be less expensive with an order of
magnitude
better performance and can use the same Arduino IDE and run Arduino
sketches. The PIC is not so beginner friendly and requires some study
before it can be used. But if you as said of course a PIC could work,
this is a pretty simple application
Chris Caudle:
You could use AVR (arduino), but once you get to most of the ARM
processors it is harder to make them deterministic because of caches.
You
want a processor where the number of clocks is constant for all or
almost
all instructions, and is easy enough that you can code the loops by
hand.
Code like TVB's divider probably doesn't even use interrupts, it's just
a
tight loop where the number of instructions is counted to give the
behavior wanted.
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/
mailman/listinfo/time-nuts
time-nuts Info Page - American Febo Enterprises<https://www.febo.
com/cgi-bin/mailman/listinfo/time-nuts>
www.febo.com
time-nuts is a low volume, high SNR list for the discussion of precise
time and frequency measurement and related topics. To see the collection of
prior postings to ...
and follow the instructions there.
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.
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.