Software based I²C library ( I²C-Slave ) for AVR's atmega
- software i2c-slave for avr's atmega family
- software i2c-master for raspberry pi ( or all devices which support wiringPi )
- time-streching
- software i2c-master for avr's atmega
- software watchdog ( please use the watchdog of your atmega )
- read and write from raspberry to atmega8 over pins you can choose ;)
- use speeds at your own choise
- make
- avr-gcc
- gcc
- wiringPi-library ( on raspberry )
Please change the variables inside config.h in the avr/ folder
- change to source-directory
- run make -f make/MakefileAVR.mk firmware
- change to source-directory
- run make -f make/MakefileGPIO.mk si2c
Usage:
-c <SDA-Port> <SCL-Port> <TIME>
-i: init - set SDA/SCL to high
-as <address>: send address on write mode
-ar <address>: send address on read mode
-s: Send i2c-Start
-r <byte>: Read i2c-byte
-w <byte>: Send i2c-byte
-e: Send i2c-stop
-t <chipAddress>: Test if address is present
For example, if you would like to send an byte
si2c -c 17 27 1 -i -s -as 4 -w 1 -w 1
- this will send byte 1 to register 1
- the target chip Address is 4
- SDA-Pin is GPIO 17
- SCL-Pin is GPIO 27