Giter VIP home page Giter VIP logo

avr-i2c-adc's Introduction

avr-i2c-adc

This repo will help you get started with using the PCF8591 A/D & D/A I2C capable converter.

Prerequisites

To be able to run these examples you will need an ATmega328/128 microcontroller and a PCF8591 module. I picked up a really awesome module on Amazon that has a built in trim pot, photoresistor and thermistor. This allowed for very fast verification of communication and A/D sampling. This module also has an LED attached to the D/A converter for quick visual verification of values being written to it.

Getting Started

Hooking up the PCF8591 module to your micocontroller is super easy. The only connections required are SDA,SCL,GND and VCC. Here is a table showing the I2C (TWI) pins on bare bones microcontrollers and the popular Arduino Uno.

Pin Function ATmega328p ATmega128 Arduino UNO
SDA PC4 PC4 Analog Input 4
SCL PC5 PC5 Analog Input 5

Compiling and Flashing

My project is using an ATmega328p with a 16Mhz clock. Update CMakeLists.txt as needed:

  • Microcontroller : set(MCU atmega328p)
  • Clockspeed : set(F_CPU 16000000)
  • Programmer: set(PROG_TYPE usbasp)
git clone https://github.com/patrick--/avr-i2c-adc
cd avr-i2c-adc
mkdir build
cd build
cmake ..
make flash

avr-i2c-adc's People

Contributors

ptrks avatar

Stargazers

 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.