• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2C on 16F628A (non-I2C PIC)

Status
Not open for further replies.
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
 

evandude

New Member
the dedicated pins would be PIC internal hardware for I2C communication, freeing up instruction cycles for your software. in a PIC without I2C support, you'd have to do it manually, in software, and it would not be as efficient.

it sounds like you are relying much too heavily on the prewritten routines in your C compiler... that's not a good way to do things, because when it doesn't have something, it's harder to figure it out yourself... as you are finding out now. I use a C compiler as well, but pretty much write all my own routines even if similar ones exist, just to get everything the way i want it.
 
The piclist should have software I2C routines you can use. I have an I2C library I've used, but it's written in JAL so I'm not sure what use it would be for you.

Mike
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top