This tutorial simply states how to calculate frequency of a pulse source using a microcontroller.
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.
1) STM32L476 nucleo board
2) Tiva launchpad or any other microcontroller board (pulse source)
3) 16×2 alphanumeric
5) 1K resistor (for LCD contrast)
2) Keil uVision5
3) Energia (for Tiva launchpad)
Install Stm32cubemx, Keil UVision5 and Energia in your PC and update them.
Open Stm32cubemx. Select Stm32l476 Nucleo Board. Select PC_13 as an External Interrupt pin.
No need to make any changes in Clock Configuration.
Select TIMER1 and set the clock source as Internal Clock. Adjust the settings in TIMER1 according to the pictures.
Give a name to your project and generate a code for Keil IDE from Stm32cubemx.
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
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