Introduction: Frequency Meter Using Microcontroller

About: We are team of Embedded Developers and love to share knowledge.

This tutorial simply states how to calculate frequency of a pulse source using a microcontroller.High voltage level of pulse source is 3.3 V and low is 0V.I have used STM32L476,Tiva launchpad,16x2 alphanumeric LCD some wires breadboard and 1K resistor.

Hardware required:-

1)STM32L476 nucleo board

2)Tiva launchpad or any other microcontroller board(pulse source)

3)16x2 alphanumeric


5)1K resistor(for lcd contrast)

Software requirement:-


2)Keil uVision5

3)Energia (for Tiva launchpad)

Step 1: Install Stm32cubemx ,Keil UVision5 and Energia in Your Pc,update Them.

Step 2: Open Stm32cubemx Select Stm32l476 Nucleo Board.Select PC_13 As External Interrupt Pin

Step 3: No Need to Make Any Changes in Clock Configuration.

Step 4: Select TIMER1 and Clock Source As Internal Clock.And Make Settings in TIMER1 According to Pictures.

Step 5: Give a Name to Your Project and Generate Code for Keil Ide From Stm32cubemx

Step 6: Connect LCD to STM3276 Nucleo Board With Connections Stated Below.

Pin connections of stm32 to lcd

STM32L476 - LCD


5V - PIN2

NA - 1K resistor connected to GND

PB10 - RS

PB11 - RW

PB2 - EN

PB12 - D4

PB13 - D5

PB14 - D6

PB15 - D7

5V - PIN15


Step 7: Connect One Pin of Tiva Launchpad to External Interrupt Pin of Stm32l476 and GND Pin of Tiva Launchpad to GND Pin of STM32L476.

If you have any other microcontroller board with you need to connect GPIO of that board on external interrupt pin of STM32L476 nucleo board and connect GND of both boards to each other.You need to toggle this GPIO pin programmatically in it's IDE.

Step 8: Demo of Project