The ARM chip almost surely has a high-resolution timer onboard, the stock Linux kernel in e.g. mainstream distros like Ubuntu isn't configured for hard realtime operation but Linux can be:
formatting link
formatting link
"Average latencies of a few uS are possible on single-CPU systems"
If you need to measure sub uS accurately Linux is probably the wrong tool.
We use a Zynq for serious projects, dual ARM and a heap of FPGA, but they are hard to get so I'm conserving them for big stuff. This little tach thing will be dinky.
The trick to (inexpensive) measuring times/intervals is to use the hardware event to trigger (or capture) something that the software can *later* get around to reading.
E.g., let it start a (hardware) timer and let the software (IRQ) read the "current time" as well as the time on the triggered timer and use the two to determine the system time at which the trigger event occurred.
(Of course, the two timers must be accessed in a single critical region but you can additionally fudge the math based on the work required to compute the difference)
There was an era when counter/timers were truly appreciated (e.g., the 9513) as nearly universal peripherals (timing, analog-digital-analog conversion, etc.).
Nowadays, timers are becoming less clever (less real estate).
On a sunny day (Mon, 18 Jul 2022 12:13:05 -0700) it happened John Larkin <jlarkin@highland_atwork_technology.com> wrote in snipped-for-privacy@4ax.com:
dunno, did not see any crystal..
In this project I use an old raspberry as signal generator.
formatting link
Look at freq_pi.c it contains part of BCM2835-ARM-Peripherals.pdf page 105 6.3 General Purpose GPIO Clocks
That is for an old Pi, have not looked up the Pi4 yet (have 2, one with 4 GB and one with 8 GB RAM) Somebody did an FM radio modulator with the old PI.
Raspberry Pies are also difficult to get these days. I use the 8 GB for web browsing,
Just been biking in the heatwave here, code orange well only 31 C, wintercoat and hat on.. its cooler on the bike (airflow) than standing still in the sun!
68332 has been around for decades and is still available. It's a wonderful chip. It has 16 TPU timer channels that could do what I want. But it's big and expensive, and doesn't have USB or ethernet.
The architecture and instruction set are beautiful. It was a joy to program. We've used about 16,000 of them so far.
On a sunny day (Tue, 19 Jul 2022 04:48:52 -0700) it happened snipped-for-privacy@highlandsniptechnology.com wrote in snipped-for-privacy@4ax.com:
Now its 36 on my outside garden thermometer in the shadow, but sure some heat comes from the fence it is hanging from. Inside way above 30 this afternoon, no aircos here.
UK seems to be in alarm mode because highest temperature ever measured in London? Somebody here pointed me to that Arabian clothing like what those sheiks have :-) Not a bad idea perhaps if it stays this way.
Yes, it really is worth looking closely at the RP2040 or the pico board. It is probably massive overkill for what you want to do, but at a cost of 1USD for the chip and 4USD for the assembled pico board it hardly matters. Digikey and Mouser between them have over 166000 chips in stock and around
33000 pico boards. In the UK Farnell and RS between them have about another
517000 RP2040 chips in stock. There is also a version of the pico with WiFi, but you probably don't need that. I am planning to use an RP2040 for a multi-phase switched mode isolated power supply.
You can add ethernet by using a LAN8720 chip, or using a cheap ready-made LAN8720 module. There is software support for this already available, although at the moment it only works properly at 10Mbit/s.
Well, we seem to have only two options, a RaspberryPi or an ARM, one being too small and the other being too large.
But there is actually a third option that falls between these two options in size, a Microchip AVR microcontroller. Programmed in a dialect of Ansi C, with code in a flash memory and loaded on startup.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.