Is this possible? PC <--USB--> Arduino UNO <--I2C--> ATTiny

Hi Folks, just a quick suggestion if you please.

I'd like to set up something like that:

  • a few ATTinys (still have to choose which kind) connected to external electronics (inputs/outputs);
  • Arduino UNO communicating with those ATTinys (I2C) and providing a centralized interface to the PC, to which it's connected by default USB (virtual serial).

This way Arduino UNO hides the complexity of the system to the PC, and the ATtinys deal with different hardware stuff independently.

But I never fully investigated on Arduino UNO <--(I2c)--> ATTiny communications. I don't know what should I expect, worse than a headache?
Suggestions?

Thanks,
Roberto

Take a look at this a I2C/TWI Master library for the ATtiny85

http://code.google.com/p/arduino-tiny/

Sounds like a slave library is needed for the Tiny's...

Start here:
http://jtoee.com/2009/12/connecting-multiple-avrarduinos-via-i2ctwi/

Anyone else having trouble getting the slave to work at 1MHz? Works fine at 4 and 8, but I can't get my UNO and ATtiny2313 to talk when the tiny is running at only 1.

Jim

I'm considering using the ATtiny85. But ...

Erni:
Take a look at this a I2C/TWI Master library for the ATtiny85
Google Code Archive - Long-term storage for Google Code Project Hosting.

I see the library is for both master and slave, that's nice, I'll use the attinys as slaves only.

What's that now?!!
Page Arduino Playground - USIi2c says that:

The ATtiny85 (and it's cousins) does not have I2C (or SPI) "built in". Instead it has a Universal Serial Interface (USI) that can be used to facilitate I2C and SPI.

But Atmel itself says the ATtiny85 has 1xSPI and 1xTWI(I2C). What am I missing?

Btw, I have at hand a few units of:

  • attiny2313
  • attiny84
  • attiny85
  • attiny4313

What do you recon solely from the "I2C capabilities" point of view? Which is more likely to get a successfull shot?

Or should I order some better suited attiny chip?

It says in the ATtiny docs from ATMEL:

  1. USI – Universal Serial Interface
    15.1 Features
    • Two-wire Synchronous Data Transfer (Master or Slave)
    • Three-wire Synchronous Data Transfer (Master or Slave)
    • Data Received Interrupt
    • Wakeup from Idle Mode
    • Wake-up from All Sleep Modes In Two-wire Mode
    • Two-wire Start Condition Detector with Interrupt Capability
    15.2 Overview
    The Universal Serial Interface (USI), provides the basic hardware resources needed for serial
    communication. Combined with a minimum of control software, the USI allows significantly
    higher transfer rates and uses less code space than solutions based on software only. Interrupts
    are included to minimize the processor load.

Aren't I2C and SPI the first 2 on the list? And it says explicitly that USI is hardware-supported and faster than bit-banging.