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

Software I2C

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



Joined: 02 Oct 2009
Posts: 11

View user's profile Send private message

Software I2C
PostPosted: Fri Oct 02, 2009 9:02 am     Reply with quote

Hi Sorry cause I originally post in the code library forum;
my question is : Is it possible to built a software I2C slave on a chip that doesn't have any hardware I2C; From the forum, the slave code that read data uses the hardware interrupt to detect that the master is sending data or requesting data.
Am I clear ?
hmnrobots



Joined: 02 Oct 2009
Posts: 11

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 9:22 am     Reply with quote

to complete : Is it possible to establish I2C communication between 2 non equipped I2C devices such as the 12F629 ? one master and one (may be more but at least one ) slave that would be able to respond to master questions ?
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 9:34 am     Reply with quote

I've never tried it but I do know that it would be EXTREMELY difficult to do. Most of the PICs time would be dedicated to just looking for the correct bus signals.

Ronald
hmnrobots



Joined: 02 Oct 2009
Posts: 11

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 11:27 am     Reply with quote

I just found this project of I2C to RS232 interface
. Coded in assembler : too hard for me !I thought It would be possible with C, don't you ?http://www.gedanken.demon.co.uk/rs232-converters/i2c.html
hmnrobots



Joined: 02 Oct 2009
Posts: 11

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 11:35 am     Reply with quote

In fact none of these are able to act as a slave on a device without hardware!I ve got to take another PIC
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 11:35 am     Reply with quote

Why would you convert I2C to RS232?

You haven't told us enough about the project -- but in any case consider this:

You need to research I2C and RS232 to learn the pros and cons of both.

Can you talk I2C to a pic that doesn't understand it? I think you can answer this question already (think: can you [spam] in a language to someone else who doesn't understand it? No.)

So once the receiving (slave) PIC understands I2C, is it better to run RS232 -- well that depends! (see above)


There are companies that make I2C -> RS232 "adapters" -- but if you want to control more than one device from a single master, I2C lends itself more to this kind of operation than RS232.

Again -- do your homework.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
hmnrobots



Joined: 02 Oct 2009
Posts: 11

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 11:56 am     Reply with quote

I was in fact thinking of an interface I2C/ RS 232 because my project uses already an I2C bus and I'd like to add a HF transceiver, but the one I'd like to use uses TTL RS232. It would be simplier to add another RS232/RS 232 but would use 2 other pins.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Oct 02, 2009 12:08 pm     Reply with quote

In that case, use a PIC with multiple UARTS.

The 18FxxJ11 is very nice.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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