Frequency Meter Using Microcontroller

This tutorial simply states how to calculate frequency of a pulse source using a microcontroller.

Frequency Meter Using Microcontroller

Story

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

Hardware required:

1) STM32L476 nucleo board

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

3) 16Γ—2 alphanumeric

4) Breadboard

5) 1K resistor (for LCD contrast)

Software requirement:

1) STM32cubemx

2) Keil uVision5

3) Energia (for Tiva launchpad)

Step 1

Install Stm32cubemx, Keil UVision5 and Energia in your PC and update them.

Step 2

Open Stm32cubemx. Select Stm32l476 Nucleo Board. Select PC_13 as an External Interrupt pin.

Step 3

No need to make any changes in Clock Configuration.

Clock Configuration.

Step 4

Select TIMER1 and set the clock source as Internal Clock. Adjust the settings in TIMER1 according to the pictures.

Adjust the settings in TIMER1 according to the pictures

Step 5

Give a name to your project and generate a code for Keil IDE from Stm32cubemx.

Give a name to your project

Step 6

Connect the LCD to STM3276 Nucleo Board with the connections stated below.

Pin connections of STM32 to LCD:

STM32L476 – LCD

  • GND – PIN1
  • 5V – PIN2
  • NA – 1K resistor connected to GND
  • PB10 – RS
  • PB11 – RW
  • PB2 – EN
  • PB12 – D4
  • PB13 – D5
  • PB14 – D6
  • PB15 – D7
  • 5V – PIN15
  • GND – PIN16

Step 7

Connect one pin from the Tiva Launchpad to the External Interrupt pin of Stm32l476, and the GND pin of Tiva Launchpad to GND pin of STM32L476.

If you have any other microcontroller board, you’ll need to connect the GPIO of that board to the External Interrupt pin of STM32L476 Nucleo board, and connect GND of both boards to each other. You need to toggle this GPIO pin programming in its IDE.

Read more: Frequency Meter Using Microcontroller

About The Author

Muhammad Bilal

I am a highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.