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 CCS Technical Support

I2C, invert SDA=C3 and SCL=C4

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



Joined: 01 May 2007
Posts: 8

View user's profile Send private message

I2C, invert SDA=C3 and SCL=C4
PostPosted: Sat Jun 09, 2007 3:18 pm     Reply with quote

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
Ttelmah
Guest







PostPosted: Sun Jun 10, 2007 3:15 am     Reply with quote

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
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