aboudou / tinywiremcp23008

TinyWireMCP23008 is a library that ease the use of the MCP23008 I<sup>2</sup>C port expander with an ATtiny85 microcontroller.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArduTemperatureMonitor

TinyWireMCP23008 is a library that ease the use of the MCP23008 I2C port expander with an ATtiny85 microcontroller.

Sources

TinyWireMCP23008 use multiple libraries:

ATtiny85 frequency and I2C bus mode

TinyWireMCP23008 was tested (and works) with a 8 MHz ATtiny85 and I2C standard bus mode and I2C fast bus mode.

TinyWireMCP23008 was not tested with ATtiny85 other frequencies, but should work (I can't guarantee that fast bus mode will work with a 1 MHz ATtiny85).

TinyWireMCP23008 should work with other ATtiny microcontrollers.

If your ATtiny does not run at 8 MHz, you have to adapt the following line into USI_TWI_Master.cpp:

#define F_CPU 8000000UL

(Example : #define F_CPU 1000000UL for a 1 MHz ATtiny85)

If you want to disable I2C fast bus mode, you have to comment the following line into USI_TWI_Master.h:

#define TWI_FAST_MODE

You can find all the schematics for the provided example into “doc/TinyWireMCP23008.fzz”, to open with Fritzing.

The breadboard assembly and schematics

Breadboard assembly Schematics

About

TinyWireMCP23008 is a library that ease the use of the MCP23008 I<sup>2</sup>C port expander with an ATtiny85 microcontroller.


Languages

Language:C++ 65.5%Language:C 20.1%Language:Objective-C 9.8%Language:Arduino 4.7%