View previous topic :: View next topic |
Author |
Message |
jumpalt2
Joined: 04 Apr 2006 Posts: 4
|
I2C problem on a 18F6722 Devboard |
Posted: Fri Apr 14, 2006 2:51 am |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Fri Apr 14, 2006 2:55 am |
|
|
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
|
|
Posted: Fri Apr 14, 2006 3:19 am |
|
|
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
|
|
Posted: Fri Apr 14, 2006 11:38 am |
|
|
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
|
|
Posted: Fri Apr 14, 2006 7:50 pm |
|
|
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
|
|
Posted: Fri Apr 14, 2006 7:52 pm |
|
|
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. |
|
|
|