RISC Controller Backs Frequency Counter

Dec. 9, 2002
Frequency measurement, often vital to design engineers, is the driving force behind this idea. Here, an AVR RISC controller-based circuit can measure the frequency of digital signals. It employs the PC as a user interface and sends the measurement...

Frequency measurement, often vital to design engineers, is the driving force behind this idea. Here, an AVR RISC controller-based circuit can measure the frequency of digital signals. It employs the PC as a user interface and sends the measurement results back to the PC through the serial port.

The user interface connects to the PC's serial port at a rate of 9.6 Mbits/s—8 data bits, 1 stop bit, and no parity (Fig. 1). The heart of the circuit, the AT90S2313 AVR RISC controller, operates at a 4.000-MHz crystal clock frequency. It counts the pulses on its PB2 input pin over the user-selectable counting period of 0.1, 1, or 10 seconds. At the end of the counting period, the accumulated count is sent to the PC in the form of four hexadecimal numbers (16 bits), followed by ASCII code for linefeed and carriage return. Until the user resets the system, the process continues.

At power on, the interface sends a message over the serial line, prompting the user to select a counting period via the keyboard (Fig. 2). Pressing 0, 1, or 2 selects a 0.1-, 1-, or 10-s counting period, respectively. If any other key is pressed, the 10-s counting period is selected by default. A terminal emulator program (VTERM under DOS prompt) is used to communicate with the interface. Similar Windows programs, such as HyperTerminal, are also effective. The data being sent by the interface can be piped to a text file for later analysis. For data plotting, Windows-based Microsoft Excel or Linux/Unix-based Gnuplot can be employed.

To download the listings, click Download the Code.

Sponsored Recommendations

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!