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 on 16F628A (non-I2C PIC)

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







I2C on 16F628A (non-I2C PIC)
PostPosted: Tue Jul 12, 2005 7:54 pm     Reply with quote

Hi,

I have some questions regarding the implementation of I2C in 16F628A.

I used to implement I2C eeprom with PIC16F877A by using #use i2c picc function. PIC16F877A has two dedicated pins (SDL and SCL) for I2C.

However for this time, I am using PIC16F628A, which doesn't have the dedicated pins for I2C. When I use Project Wizard in PICC, the I2C option has been greyed out.

1. Is there anyway to use I2C with P16F628A, in PICC?

2. If we still can implement I2C with P16F628A, why does CCS PICC grey it out? What is the purpose of dedicated pins, if we still can implement I2C with or without them?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jul 12, 2005 8:33 pm     Reply with quote

The dedicated SDA and SCL pins can be used for hardware i2c. CCS has
library code to support hardware i2c. This is invoked with the
FORCE_HW parameter in the #use i2c() statement.

If you want to do i2c on other pins, CCS has a library for software i2c.
However, the software i2c can only be used for Master mode, not Slave.
Kit
Guest







PostPosted: Tue Jul 12, 2005 10:58 pm     Reply with quote

If everything can be done in software, why does the PIC Wizard grey out the I2C options?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 13, 2005 12:03 am     Reply with quote

I don't have PCW, so somebody else will have to tell you about
using software i2c with the Wizard.
Ttelmah
Guest







PostPosted: Wed Jul 13, 2005 3:18 am     Reply with quote

Kit wrote:
If everything can be done in software, why does the PIC Wizard grey out the I2C options?

The wizard only provides controls for the hardware features. The same applies to RS232, where you can only setup hardware ports with the wizard.
The options are greyed out when hardware does not exist to spcifically support the option. All you have to do, is setup the required #use I2c line yourself.
Realistically, I consider the wizard, the source of more problems than it solves!. However what they should perhaps do, is add an entry to the 'drivers' selectable, for 'software I2C'.

Best Wishes
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Jul 13, 2005 8:34 am     Reply with quote

You also have the option of just bit-banging it.

Ronald

Smile.... you're one day closer to retirement. Rolling Eyes
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