Q: Software 400kHz I2C slave on ATmega644 clocked 10MHz?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

just a quick question:

will it be fruitful pursuing software I2C slave implementation on ATmega644 clocked 10MHz? What if it were clocked 20MHz?

thanks,
Andrei

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not? Use the TWI slave mode. Or bitbang it using interrupts; if the master is truely I2C compliant it should support clock stretching, so you can slow down the master if it's going too fast.

Read this appnote... AVR311

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It should work just fine. I2C is slow compared to the cycle time at 10 MHz (100 ns). Use the TWI interface to allow the hardware to work with you. Check the Atmel Application Notes for code running an AVR as an I2C (TWI) Master.

I'm using 100 KHz I2C on my 14.7456 MHz mega2560 with no problems. I was running 400 KHz, but the Philips I/O extenders don't like that high frequency stuff. :-?

Stu

Edit 1: Dang! JayJay beat me! :wink:

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for courage.

I'll give it a try.