anindyamitra15 / stm32-gpio-modes

GPIO modes like ADC, Button (Digital Input) etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPIO Modes/Functions on STM32F103

Introduction

Experimenting with the plethora of GPIO modes and functionalities which are available on STM32F103C8T6.

Contents

|_ adc_cpu_poll
|_ digital_input
|_ pin_interrupts
  1. ADC Poll for Conversion Mode: In this project, a GPIO is used as analog input to the ADC. HAL_ADC_PollForConversion is used to obtain the ADC reading. Here the CPU waits for the sampling and conversion process inside the microcontroller ADC unit. This is the simplest implementation useful for infrequent ADC readings.

Demo

Output is shown on Arduino's Serial Plotter via UART1 of STM32 through FTDI breakout

  1. GPIO as Digital Input: This is a very basic functionality of GPIO, digital input.

Demo

PuTTY serial shows the logic at the GPIO input

  1. External Interrupt through GPIO: A falling edge interrupt was configured, which when triggered, toggles a boolean flag, which enables or disables the blinking of an LED on another GPIO.

Demo

Working shown in GIF

Other experiments:

Also checkout my other works with STM32F1: STM32F103 RTOS, STM32F103 UART and, STM32F1 PWM Modes

About

GPIO modes like ADC, Button (Digital Input) etc.


Languages

Language:C 84.9%Language:Assembly 15.1%