I've got an Si4703 breakout from Sparkfun, which communicates via I2C. I have gotten it to work very easily using a regular 3.3V Arduino Pro Mini, but am now trying to move everything over to an ATtiny85. It seems this should be possible, but my I2C knowledge is basically zero.

I have everything laid out on a breadboard:

  • ATtiny chip with 3.3V power and ground from a good power supply
  • Si4307 on the breadboard too
  • SDIO on digital pin #0 (pin 5 on the chip) with a 4.7K pull-up running to 3.3V and out to the breakout
  • SDLK on digital pin #2 (pin 7 on the chip), same as SDIO
  • A reset pin for the breakout, running from digital pin #1

I've verified this with the Pro Mini and it works great, so I'm doubtful the problem is here.

My ATtiny is set up using the TinyWireM library for I2C, and using a customized version of the Sparkfun Si4703 library. <-- if I had to guess, this is where the problem probably is... I think

My modded library files are here (too long to paste in the forum):

And my Arduino code:

#include <TinyWireM.h>
#include <Si4703_ATtiny.h>

int SDA =   0;       // I2C data pin on ATtiny85
int SCK =   2;       // I2C clock pin on ATtiny85
int reset = 1;       // can probably be any digital pin

Si4703_ATtiny radio(reset, SDA, SCK);

void setup() {
  TinyWireM.begin();    // need this?

void loop() {

I've tested both the Pro Mini and ATtiny85 version using my scope, but I'm pretty new to that tool, especially for I2C. I see similar clock and data patterns from both versions, and can see that there is readable I2C data from the ATtiny on my scope (it is finding readable hex data and sees it is ACK-ed, at least some of the time). I have programmed ATtiny chips through the Arduino IDE before, so I'm pretty familiar with that process, and double-checked things are outputting using an LED.

I'm not anywhere near an I2C expert, and have never built an Arduino library, so I'm guessing I need some help with my modded library (unless I'm missed something else obvious).

  • Why all this trouble ? The ATtiny85 is not officially supported by Arduino and a ATmega328p in a small package is also very small. – Jot Jun 5 '17 at 2:17
  • 1
    @Gerben – the problem is it doesn't work! Since the ATtiny85 doesn't have serial, I can't easily see what the problem is. Was hoping someone with more knowledge could help find where the issue might be (the modded library code, etc). – JeffThompson Jun 5 '17 at 12:09
  • 1
    Try adding an led for debugging. – Gerben Jun 5 '17 at 12:16
  • 1
    @Gerben – I did (it's in the post, but there's a lot of info). I put one on the SDIO and SCLK lines, just to see if stuff is coming out. I can see I2C-looking data on my scope too, so I think the problem is code, not circuit. – JeffThompson Jun 5 '17 at 12:27
  • 1
    The Si4703 has an approach that I'm not used to. It reads for example 32 bytes, and waits for ever after the requestFrom. You can remove that wait loop, it has no use. It uses millis in the wrong way. I think that the TinyWireM can do only 16 and not 32 bytes with requestFrom. Could you try other Si4703 code that is more "normal" ? – Jot Jun 6 '17 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.