Credit to :
1. http://www.jechavarria.com/2013/06/28/components-i-usually-use-ii-24lc256-i2c-eeprom-memory/ that i learn there need a delay of 5ms for each write. Once i got it, the rest is easy.
2. https://www.reddit.com/r/arduino/comments/19typ5/attiny85_with_external_i2c_eeprom/ that i learn to start with the circuit
Here is the photo:
The video:
The circuit:
I am using 2 x 1k ohm resistor to pull up insteads of the 4.7k ohm resister as recommended in the link above.
The source:
Writer - https://drive.google.com/open?id=0B1Ozs0W50qCpekFoMm14eDl1bVU
Player - https://drive.google.com/open?id=0B1Ozs0W50qCpWnVwSk5ZZ2tyRWc
Note:
I am using TinyWireM.h and make the following changes. As I am writing and reading 64 bytes at one time, I change the buffer to 67 in USI_TWI_Master.h below. And I find I do not need to change the clock speed from 1000.0 kHz to 8Mhz which my Attiny85 is running. It still runs!
#define USI_BUF_SIZE 67 // bytes in message buffer
#define SYS_CLK 1000.0 // [kHz] Default for ATtiny2313
No comments:
Post a Comment