SX based 15 MHz frequency counter.

( by Alberto Geraci of BTX Sistemas – Argentina )

It is a simple frequency counter project based in a SX28 microcontroller from UBICOM, it doesn't try to be an exact instrument measurement, only try to demonstrate, with a very low cost and low quantity of materials, ( only two IC’s ) how much we could get from an SX28 plus the RS232 serial port in a PC.

Let me to leave to the people who read this article to experiment with it, make some changes, or apply new ideas. If you like you could write to me at btxsistemas@ciudad.com.ar .

I accompany in this article, the complete schematic diagram for the frequency. counter, a picture with the software in action and all source code, for both the SX and the PC.

The project is in a basis of two parts, one is the SX code which implement all frequency count, and the RS232 serial communication.

The second part is the PC software that only reads the data sent by the SX and show its in a window who simulate a standard frequency. counter.

This lets the PC software to be not responsible about the maximum wave frequency to be tested, and leave to the SX code all the quickly job, taking advantage of the 50 MIPS.

I think that using a different external counter in this project, you could get much more than 15 MHz wide of band for the frequency. counter.

About SX code:

The original idea to measure the external input frequency as quickly as possible with the SX28 in this project is the following:

The signal to be measured need to be an square wave ( you could do this with any schmitt trigger gate ) and it will be the clock for an external counter, that ‘count’ how many input pulses receive during a exactly elapsed time.

This time, is the called "time base" of the frequency counter and it’s given by the SX software, like this instrument is totally auto-range, the SX software will take more than one measure to know exactly the value of the input frequency, giving in only 12 bits of resolution ( 12 bits external counter ) a complete result in 8 decimal digits in the display. ( PC software display ).

How to do this ?, Ok we will take first a 0.5 seconds ( time base ) value of the counter, and after that a 1/4096 seconds value, this two measures will give us, four byte of data to be send to the PC software.

And that is all we need, then the PC soft will make some calculation to get the decimal frequency value.

OK at this point we have a lot of different possibilities to change or to add, I think the first and most important to get more speed, for measure higher frequencies, is the change of the external counter, in this project to demonstrate the work, I was using the 74HC4040 which have a 12 bits of resolution, so think about a 16 bits counter to get a 4.29 GHz (theoretical) or real= the maximum input clock frequency. of the counter.

You must use (change in SX soft) the entire rb and rc port to read all this 16 bits and let the ra.x bit to implement the serial communication.

About the PC software:

The PC software was entire programmed in Visual Fox 6.0, all the code is not available for you , the idea was to create an small window into a dialog based application, which shows you the frequency. measured with the hardware.

You can install the software by clicking only in the setup icon, be carefully to get installed and registered the Microsoft MSCOMM 6.0 control in your windows version, This software is only for windows application, you can’t use it with another operating system.

When you start the software, you can see an rectangle window with a pict simulating the frequency counter, it has only two buttons to control it, one is the power button to close the soft and the another is the COMX select button to choose the COM port to work.

Like we said before, the frequency counter is full auto range and you don’t need to make changes in the time base of it, this software will receive four bytes of data every 0.6 seconds ( approximately ) and it will convert it in a big decimal display to be read for you, in the case the hardware is not connected the software will show off the display, NO error is advised.

The software language is only in English version to get Spanish version write to btxsistemas please.

OK That’s all folks, and I hope, that you enjoy it

Alberto Geraci

BTX Sistemas.

NOTE: YOU CAN USE THIS PROJECT ONLY FREE, FOR NON COMMERCIAL PURPOSES WITHOUT MY AUTHORIZATION.