I2C Routine

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Widgetman
Posts: 136
Joined: Sun Dec 16, 2007 7:39 pm
Location: Florida

I2C Routine

Post by Widgetman » Sun Oct 23, 2011 2:35 pm

Hi ALl,
I have a need to interface a PIC 18FXXJXX part to a serial EEPROM and was wondering if anyone have any sample routines that might help guide me in the right direction. I am familiar with I2C stuff, I just never have interfaced one to a PIC. Any thoughts or help would be appreciated.
Thanks

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Sun Oct 23, 2011 2:58 pm

Look in the Samples directory. There are examples for I2C and SoftwareI2C routines.

Widgetman
Posts: 136
Joined: Sun Dec 16, 2007 7:39 pm
Location: Florida

Thanks

Post by Widgetman » Mon Oct 24, 2011 12:42 pm

Hi Jerry,
Thanks once again. I had not thought to look there. So far I think I am going to target the 25LC640A or something similar. I wish I could find a RTC and EEPROM storage part in one, but so far I have not had any luck finding a chip like that. Worse case I find a seperate RTC part to go along with the EEPROM.

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Mon Oct 24, 2011 1:18 pm

>I wish I could find a RTC and EEPROM storage part in one

There are a number of devices like that, although you may not find one with as much eeprom as you want. Check out the MCP79410. Usually you get ~1K (bits) or so, but I'm sure there are others.

>I am going to target the 25LC640A

The 25xx series eeproms have an SPI interface. It's the 24xx series that are I2C

EDIT: it looks like a lot of the combo devices aren't made anymore. About the largest I could find were ~512 bytes (Dallas/Maxim DS1388 and Intersil ISL12026)

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Post by RangerBob » Mon Oct 24, 2011 2:40 pm

A RTC and storage part i've been using lately that may be useful to you has been the DS32C35.

I2C RTC with integrated TCXO & crystal and 8K Non-volatile FRAM.

FRAM means no-backup supply needed just like EEPROM, but it has no write cycle limits plus it's very fast to write!

TCXO means it seems to stay pretty darn stable too.

Rangerbob

Widgetman
Posts: 136
Joined: Sun Dec 16, 2007 7:39 pm
Location: Florida

SPI Mode

Post by Widgetman » Mon Oct 24, 2011 2:51 pm

Hi Guys,
Thanks for the input. I actually meant I wanted to use SPI mode not I2C so hopefully there are some examples in the compiler for the 18F parts I can look at to get started. I ran across a MCP79410 part that has EEPROM and RTC in one SO-8 part, but I am not sure 128 bytes will be enough for me.

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Mon Oct 24, 2011 3:00 pm

RangerBob's got a good point. Didn't think about FRAM.

Ramtron has some RTCC/FRAM parts with a lot of storage (up to 32K bytes) and either SPI or I2C interfaces. See http://www.ramtron.com/products/integra ... anion.aspx

It looks like the SPI ones are 3V parts

Post Reply