Give some space or a microcontroller like a frequency meter

Everyone knows about satellite coordinate systems. They also let you know the speed and current time. On the basis of such systems, exact time servers are constructed, which have already been mentioned many times here, and not only here. The accuracy of these systems is growing, the price is falling, in short, progress is not standing still. It would seem that recently it was a matter of milliseconds, and now microseconds do not surprise anyone. And the day is not far off when ...







Honestly, this day has already come for me. Not so long ago, I came across the information that one of the manufacturers for its modules promises an accuracy of the PPS output signal interval of the order of tens of nanoseconds.







In other words, a second standard appeared with very decent accuracy. True, it is not always at hand, and often depends on external circumstances, but you can achieve favorable conditions and get it. And, most importantly, how to copy yourself.







Just in case, I looked at how things are going with other manufacturers of similar products and found about the same technical specifications. “A trend, however,” a thought flashed through my head, roughly like that of Stirlitz. It was necessary to do something.







Those readers who know how to solder a resistor from a printed circuit board or how to solder a microcircuit and even know how to do it, mentally agree with me that having a frequency meter that ensures accuracy of 7-8 characters will never hurt. Especially if it takes up little space, and you do not have to borrow a lot of money to buy it. And those who do not like to stop thinking can think of a watch that is mistaken for a few seconds a year (in the seventh digit, Clara). Fans of amateur radio communications will probably recall the design of a good home-made narrow-band filter on quartz resonators.







The first thing to do was to find the right hardware. I liked the simple evaluation board with a small Teseo-LIV3F module from a well-known company. Below is what she looks like.













This thing is sold with a remote active antenna, which can be installed closer to the window so that the satellites can “see” well. Jumpers are placed on the board as required for our further storytelling and successful programming. The photo also contains circuitry improvements in the form of a single diode with good speed.







The scheme of improvements will be shown below. The manufacturer provided that this board can be inserted into a suitable Nucleo evaluation board with a microcontroller on board (in fact, these are connectors for the Arduino, but I don’t want to leave with 32 bits). In the description of the GPS / GNSS module itself, I found the following.













This is very good and may serve as a first approximation to a good frequency counter. Now I have a very accurate second interval, and I can calculate the oscillation frequency, for example, of my own thermostatically controlled crystal oscillator. And even, perhaps, to tune it in the direction necessary for itself. It will be then, probably. In the meantime, I wanted to measure the frequencies of quartz resonators accumulated in the economy.







A suitable Nucleo series board is built on the STM32L476RG. It comes without a quartz resonator (the clock does not count). Below the photo shows the arrows where the missing elements had to be soldered.













This board option is selected for three reasons. First, the microcontroller generator with an external resonator operates from 4 to 48 MHz. Not all Nucleo microcontroller boards have such tolerances. We will run this generator with our quartz. Second, the serial port (UART) can be clocked from a separate built-in RC generator with an accuracy of 1% at a frequency of 16 MHz. Therefore, it will not be necessary to change the settings and dividers in the UART configuration with a change in the frequency of the external generator. And most importantly, a place for wall mounting is provided for the quartz resonator, where you can install the connectors so as not to solder the next resonator each time.







The serial port is already connected to the virtual USB port in the on-board debugger. So you can use the terminal emulator to display information. After refinement and installation of two scraps for the quartz from the collet connector, the board looks as follows.













Now we need to start the timer for exactly one second, and it will count the pulses of its system clock, that is, the frequency of our quartz resonator. Fortunately, the timer provides a mode in which it is simultaneously reset and starts from the rising edge of the external pulse.







I immediately wanted to make it so as not to average a few second measurements, but to measure the frequency in ten seconds, that is, more accurately. For this, in fact, it was required to add a diode to the circuit and support this idea programmatically. The refinement of the circuit is shown below.













The following diagrams show how to make a 10 second interval from a second.













The PPS signal is supplied to the timer via a diode, and directly to the additional external interrupt input. In the interrupt from the timer, an external interrupt is allowed, which, counting up to ten, prohibits itself and changes the pull-up resistor from upper to lower.







The red arrows indicate the moments of the timer interrupt operation, and the green indicate the moments of the start of the external interrupt, according to which the required second intervals are considered. Blue shows on-off pull-up resistors. The project was made in IAR and you can see it here . The photo below shows the result of the controller program in conjunction with the terminal emulator, which shows the steady state.













To see the graph, and not the dry lines of frequency values, I had to compose a small utility for Windows. Her carcass is in the same place as the firmware project.







All experiments were performed according to the same scenario. Before measurements, the board was left for fifteen to twenty minutes in the refrigerator, where it was slightly below zero. Then it was naturally heated to room temperature for half an hour. Then the board and the resonator received warm air from the hair dryer for several minutes (here the same conditions did not work).







Good resonators behaved well, that is, in accordance with the temperature dependence of the AT cut of the crystal. These graphs (or multiple copies?) Are easy to find on the net. The results of measurements of three resonators at 16 MHz are shown below.













Then it turned out that there are exceptions to the usual picture of behavior. The data below shows two quartz of the same type and, most likely, of the same origin, which behaved differently.













On the resonator, which behaves as usual, I just breathed a little, and the second decided to heat more, because it showed itself differently. How easy it is to see the temperature dependence of him or shifted, or just another.







Another interesting observation. After exposure to temperature, the resonator does not return to past frequency values, or I did not have the patience to wait. In any case, it doesn’t matter if you don’t care about the signs after the sixth.







Here is another observation. This is one and the same resonator, which had to be measured twice, because it caused surprise. I have not yet found an explanation for such behavior and have not come up with.













It would be useful to remove the individual temperature dependence of the frequency for an individual resonator. Then you can make a highly stable generator of second intervals using a good temperature sensor and knowing the temperature curve of the resonator. However, this will already require a heat chamber. I wonder which temperature sensors can be considered good today?








All Articles