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 Read with 12F629

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







I2C Read with 12F629
PostPosted: Mon Jun 07, 2004 10:11 am     Reply with quote

Is it possible to read I2C with 12F629 which does not have a I2C engine and does not support I2C_READ() library.

How complex is it to write this routine so that 12F629 can read.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 11:20 am     Reply with quote

The I2C functions do not require a hardware module that supports I2C. They can be use on a software port. I2C functions are not dificult to write.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 11:35 am     Reply with quote

If all you want is a Master I2C controller then you can use the built in I2C functions. Software I2C in a Slave is a bit more difficult.
falleaf



Joined: 23 May 2004
Posts: 48

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 12:22 pm     Reply with quote

Have you got some examples of I2C communication on C? I'm trying with CCS C! << Usually use MPASM, but learning to use C.
The rookie
Guest







The built in I2C funtions
PostPosted: Mon Jun 07, 2004 4:39 pm     Reply with quote

According to the manual. The master I2C write, start and stop do not require and I2C engine in the micro. But the polling and read is not supported by 12F series micros do not support the builtin I2C read()
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 4:47 pm     Reply with quote

You need to state whether you want the 12F629 to be an i2c Master
or an i2c Slave.
falleaf



Joined: 23 May 2004
Posts: 48

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 8:41 pm     Reply with quote

Oh sorry, I would like to reference for a standard I2C routine in C only. I'm working with 16F876a. I need both master and slave code examples.

May you send me them?

Well, the fact that the slave examples in CCS C is only so simple and it's random read buffer, so I cannot imagine the way to write.

I wrote I2C under ASM, and there are some bits needed to notice. I don't know if writing in C need or no need to check these bits?

For example,

I write PWM in C. To change PWM duty cycles, I need to wait until timer2 is overflow, but I don't know C code will do it or not? Because it only has the set_pwm_duty function only.

I don't know if I have to check timer2 overflow or not?? It's the similar question as I write I2C in C. I'm newbie in C for PIC. Thanks muchie.
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