ATtinyx5 I2C master (and 2Mbaud)

Your source for all things Atmel.

Moderator: phalanx

Post Reply
tz
Posts: 148
Joined: Sun Aug 23, 2009 10:40 pm

ATtinyx5 I2C master (and 2Mbaud)

Post by tz » Sun Dec 06, 2009 10:11 am

I had trouble with Atmel's application note so I redid it. I also switched to assembly and made the SCL timing as uniform as possible. This is 400kHz (a bit faster at 10Mhz, a bit slower at 8 but works without a crystal).

And I actually commented it.

http://harleyhacking.blogspot.com/2009/ ... -good.html

Archives and test programs are at some of the other posts.

I also coded a 2Megabaud [edit:]UART output (at 10Mhz) driver so I could use my FTDI breakout to read back things without hogging the CPU.

http://harleyhacking.blogspot.com/2009/ ... roved.html
Last edited by tz on Sun Dec 06, 2009 12:48 pm, edited 1 time in total.

stevech
Support Volunteer
Posts: 2907
Joined: Sat Jun 05, 2004 8:51 pm
Location: USA, California

Post by stevech » Sun Dec 06, 2009 12:16 pm

nitpick: "baud" is normally used with asynchronous serial data (UART), with start/stop bits.

SPI, I2C, and other clocked data systems tend to use the term "bps"

tz
Posts: 148
Joined: Sun Aug 23, 2009 10:40 pm

Post by tz » Sun Dec 06, 2009 12:46 pm

I should clarify, the 2 Megabaud goes to my FTDI serial breakout when it is set to 2000000 baud. Yes, async - 1 start bit, 8 data bits, minimal 1 stop bit (usually somewhat longer since you have to reenter the routine and it takes a few clocks). With a 15Mhz Xtal it would be 3Mb.

Post Reply