CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I2C problem on a 18F6722 Devboard

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jumpalt2



Joined: 04 Apr 2006
Posts: 4

View user's profile Send private message

I2C problem on a 18F6722 Devboard
PostPosted: Fri Apr 14, 2006 2:51 am     Reply with quote

I have a 16F88 and a 24AA1025 I2C EEPROM on a breadboard. Everything works peachy using the #use I2C() and the example code in EX_EXTEE.C (modified to work with the 16-bit pointers the 24AA1025 requires). I recently got my 18F6722 dev board in, so I thought I'd see if I could get it to work with the eeprom. I used the same code in the 18F6722, but I changed the #include to use 18F6722, and I changed the SDA and SCL pins.

I left the eeprom in the breadboard and connected the SDA and SCL pins on the eeprom to the dev board with some breadboard wires (about 4" long each) by pushing the wire into the pin header on the dev board. I also connected the grounds together on the boards.

Hooking up the logic analyzer to the SDA and SCL lines shows that the 18F6722 is sending the proper signals for the write and read, but when it comes time for the eeprom to take control of SDA and respond with the data, it doesn't work properly. The eeprom responds with all the ACKs appropriately, but the actual data comes out incorrect.

I've tried using SLOW and FAST mode, using different pins with software. I've used FORCE_HW when connected to the hw I2C pins. I've tried pretty much everything I can think of, all with the same result.

I know the I2C bus has a capacitance limit of 400pF or something of the sort. Could that be my problem here? I know that breadboards aren't the best, but I thought it should be ok seeing as the 16F88 can talk to the eeprom (both on the breadboard) just fine. Suggestions?
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Apr 14, 2006 2:55 am     Reply with quote

Are the pullup resisitors in place?

How have you connected power between the two boards?

Do you have decoupling capacitors on the breadboard?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
jumpalt2



Joined: 04 Apr 2006
Posts: 4

View user's profile Send private message

PostPosted: Fri Apr 14, 2006 3:19 am     Reply with quote

Ah, sorry about the lack of information. I'm using 4.7k pull-ups on the breadboard on SDA and SCL. I am using 0.1uF decoupling caps on the breadboard. The breadboard has its own power supply, but I did connect the grounds on the two boards together.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 14, 2006 11:38 am     Reply with quote

Quote:
I have a 16F88 and a 24AA1025 I2C EEPROM . Everything works
peachy using the #use I2C() and the example code in EX_EXTEE.C

I don't see a CCS driver file for that EEPROM in the \Drivers folder.
Did you create your own driver ? How ?

Quote:

I recently got my 18F6722 dev board in. I changed the SDA and SCL pins.

What are the new pins ?
jumpalt2



Joined: 04 Apr 2006
Posts: 4

View user's profile Send private message

PostPosted: Fri Apr 14, 2006 7:50 pm     Reply with quote

PCM programmer wrote:
Quote:
I have a 16F88 and a 24AA1025 I2C EEPROM . Everything works
peachy using the #use I2C() and the example code in EX_EXTEE.C

I don't see a CCS driver file for that EEPROM in the \Drivers folder.
Did you create your own driver ? How ?

Quote:

I recently got my 18F6722 dev board in. I changed the SDA and SCL pins.

What are the new pins ?


Sorry, I wasn't very precise in my post. EX_EXTEE.C uses the 2416.C driver. I modified the 2416.C driver to work with 16-bit pointers. I used PIN_C4 for SDA and PIN_C3 for SCL as specified in the 18F6722 datasheet.
jumpalt2



Joined: 04 Apr 2006
Posts: 4

View user's profile Send private message

PostPosted: Fri Apr 14, 2006 7:52 pm     Reply with quote

The breadboard I'm using is pretty old. I moved to a newer (and smaller) breadboard and everything is playing nice now. I left the wires on the old breadboard and just took out the chip so I could verify my connections. It was definitely hooked up right. I think that spot on the breadboard is just a little insane. Actually, it is only a few rows away from the spot on the breadboard where a mosfet let out the magic smoke. Hmmm...

Anyway, it was an issue with the breadboard. Thanks for your help, everyone.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group