I2C pins question

Information and discussion regarding the main Firewing development board

I2C pins question

Postby Coccoliso » Thu Aug 06, 2015 8:12 am

Hi,
default ports for I2C in FW PIC24 version are connected to RP3/RB3 (SDA line) and RP15/RB15 (SCL line).
These two ports are not 5V compatible but I guess I can do a 10K pull-up to 5V to connect a PCF8574 .. or burn everything :roll: ?
Someone has already tried?
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: I2C pins question

Postby David John Barker » Thu Aug 06, 2015 1:45 pm

PIC SDA and SCL lines are fixed in harware, they are not remappable. To maintain pin compatibility with Arduino, Firewing uses software I2C on pins which are not 5v compatible. That said, you can use the hardware pins located on the PIC using the HI2C library, which will provide 5v compatibility.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: I2C pins question

Postby David John Barker » Thu Aug 06, 2015 1:48 pm

...I should add, a correctly implemented I2C bus should be open drain. In other words, pulling up to 3.3v (not 5.0v) will work for most 5.0v systems. This is because 3.3v is normally enough to be interpreted as logic high. In summary, pull to 3.3v and not 5.0v between Firewing and 5.0v peripheral.

This means you will be fine using software I2C library mapped to default Arduino compatible pins.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm


Return to Main Board

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x