Experimenting with the plethora of GPIO modes and functionalities which are available on STM32F103C8T6.
|_ adc_cpu_poll
|_ digital_input
|_ pin_interrupts
- 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.
Output is shown on Arduino's Serial Plotter via UART1 of STM32 through FTDI breakout
- GPIO as Digital Input: This is a very basic functionality of GPIO, digital input.
PuTTY serial shows the logic at the GPIO input
- 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.
Working shown in GIF
Also checkout my other works with STM32F1: STM32F103 RTOS, STM32F103 UART and, STM32F1 PWM Modes