GithubHelp home page GithubHelp logo

fooker / attiny85-i2c-pwm Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 2.0 11 KB

I²C controleld PWM generator based on ATTiny85

Makefile 9.43% C 89.26% C++ 1.31%
attimy85 i2c i2c-bus i2c-device i2c-slave pwm avr avr-gcc twi

attiny85-i2c-pwm's Introduction

ATTiny85 - I²C - PWM

This is a firmware for ATTiny85 microcontrollers providing a PWM signal controlled via I²C. The microcontroller acts as a I²C slave and allows a single byte write operation which is used unmodified as PWM output value.

Pins and Wiring

Beside the usual VCC andGND pins, the following pins are used:

  • 5 (PB0) - I²C SDA
  • 6 (PB1) - PWM output
  • 7 (PB2) - I²C SCL

The I²C pins utilize the internal pull-ups but external pull-up resistors should be added according to the specifications.

Configuration

The configuration can be done by mondifying config.h accordin to the needs. Right now, there are only two options to set:

  • TWI_ADDRESS - Contains the address of the slave on the I²C bus. This must only contain the leading 7 bit of the address without the R/W flag.
  • PWM_PRESCALER - The prescaler to use for the PWM output. See Table 12-5 in the ATTiny85 datasheed vor valid values. All settings are relative to 8MHz CPU frequence.

attiny85-i2c-pwm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.