![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
tiryaka
Joined: 01 May 2007 Posts: 8
|
I2C, invert SDA=C3 and SCL=C4 |
Posted: Sat Jun 09, 2007 3:18 pm |
|
|
Hello
I am using I2C to communicate between a PIC16F877 and a 24LC16 eeprom using C4 as SDA and C3 as SCL, and it works fine.
So,
In an application I can't use C4 and C3 because they are already used, so I tried D2 and D3, but it dones'nt work, I changed of course the statement
#use I2C ..........
Is it possible to use I2C with any pin??
I have tried also and I was suprised that if I invert and use C3 as SDA and C4 and SCL it doesn't work
#use i2c(master, sda=PIN_C3, scl=PIN_C4).
I simulate it with Proteus Isis and it doesn't work
Thank you |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Sun Jun 10, 2007 3:15 am |
|
|
It'll work with any pin, _but_ if using anything but the two hardware pins, the 'correct' way round, the I2C, is performed in software. In software, the I2C, simulates an open collector drive, by toggling the TRIS on the pins. My guess would be that Proteus, does not handle this correctly.
There are quite a few problems like this with Proteus. It is a pretty 'fair' simulator, but as soon as you start doing slightly 'non standard' things, it can have problems. The only way to know for sure, would be to put the code into a real chip, and try. Provided you are changing nothing else, and it did work before, I'm 99.99% sure you will find it works fine.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|