This PIC Is A Squarewave Generator

When we use a microcontroller to flip a few GPIOs or talk SPI to a peripheral chip, we are often overlooking that it will usually contain an array of built-in peripherals that were once the preserve of extra hardware. Analogue ports, timers, UARTs, and clock generators, to name just a few. [Giovanni Bernardo] has been experimenting with one of these, the internal frequency synthesiser on many PIC microcontrollers, and he’s  produced a handy square wave generator for which he’s placed code on GitHub and produced a write-up (Italian language, Google translate link).

The board used is a PIC16F375 Curiosity Nano, and code takes input from a rotary encoder to set the frequency, with a button to select different step sizes and an alphanumeric LCD display to show the current settings. Frequencies from 1 Hz to 15 MHz are possible, with a clever switch between two of the PICs internal clocks to be used as the reference frequency. Stability depends upon whatever source the PIC uses for its own clock, and while we suspect that will be enough for most users it’s not inconceivable that the PIC could be clocked from a GPS-disciplined source or similar were there a requirement for it.

There are plenty of ways to generate square waves from a microcontroller. Most projects use waveform generator ICs.

3-digit Frequency Meter

Flow sensors are useful tools for collecting data on the rate of liquid usage, but they need a device to display the data they collect. This three digit frequency meter was designed by [Turbokeu] to do just that, converting a Swissflow SF800 flow sensor’s square wave signal (similar to fan RPM signals) into an numerical expression of liters per minute on a 3 digit LCD. Fan RPM is

[Turbokeu] provides detailed schematics of different configurations for the frequency meter as well as schematics of the layouts of the two PCBs that are used. Even if you don’t have an immediate use for a frequency meter, his clean and readable schematics are worth a look in their own right. The display is installed on front of a tower case along side a CPU speed display.

[via YourITronics]