Code Monkey home page Code Monkey logo

stm32f030-cmsis-adc's Introduction

STM32F030-CMSIS-ADC

This project contains the bare minimum code required to demonstrate how to read an ADC input in order to control the blinking rate of an LED, and also outputs the ADC value out to a serial terminal via the USART if a USB serial dongle is used.

Software Setup

The basic steps to set up and read the ADC are as follows. (See main.c for details.)

  • Enable the ADC and GPIO clocks on RCC, and set up the GPIO as an ADC input.
  • Perform calibration of the ADC.
  • Enable the ADC peripheral.
  • Set the ADC channels to be cycled through for reading.
  • Read the ADC value in the main loop of the program.

Wiring

  • Connect an LED with a 1K current limiting resistor between GPIO A5 (pin 11) and ground.
  • Connect VDDA (pin 5 on the STM32F030F4) to VCC.
  • Connect the outside terminals of a potentiometer (at least 1K) to VCC and GND. The center tap of the potentiometer goes to GPIO A4 (pin 10).
  • Connect the RX line from the USB serial dongle to USART1 TX (pin 8), and connect the GND wire of the USB serial dongle to GND on the circuit. In order see the serial output, a serial termainal must be used. See STM32F030-CMSIS-USART-lib for details.

stm32f030-cmsis-adc's People

Contributors

ezdenki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.