Page 1 of 1

I2C Pin selection problem

Posted: Mon Feb 05, 2018 2:12 pm
by Lord Grezington
Hello

I am using the dsPIC33EP MC and trying to get I2C working with a temp sensor. However I think I have a pin problem. I am using software I2C with SDA on B8 and SCL on B7.

The Clock seems to work OK, but the Data just gets pulled high and stays there.

I have checked the B8 pin by doing a simple pulse program and it fine.

I then swapped the CLK an SDA pins (so SCL is now B8 and SDA is now B7) and now the data works and not the clock... So this now leads me to believe it could be stuck on an alternative function. This is the name for the B8 pin TCK/TDO/RA10 CVREF1O/ASCL1/RP40/T4CK/RB8

TCK & TDO are for JTAG which is OFF from configuration bits
RA10 is not used or designated
CsVREF10 is the OPAMP voltage reference (I have neither enabled nor disabled this)
ASCL1 is the alternative synchronous clock. However this is disabled in configuration and I am also using software mode!!
T4CK is a timer 4 input (not used or initiated nor disabled anywhere)

There are 4K7 pull ups as well.

I have attached the datasheet to save you needing to do the searches.

Thanks

Re: I2C Pin selection problem

Posted: Mon Feb 05, 2018 6:09 pm
by Benj
Hello,

My main concern would be the comparator however it appears that this is off by default so should be ok.

Could it be a circuitry issue like maybe a dry solder joint? If you simply toggle the output on and off can you say drive a LED connected directly to the pin?

Re: I2C Pin selection problem

Posted: Tue Feb 06, 2018 8:21 am
by Lord Grezington
Hi Ben

Thank for the reply, but I have already toggled the output and it worked OK:
I have checked the B8 pin by doing a simple pulse program and it fine.
I have another i2C working on C3 & C4 which works without a problem. I used a separate i2c bus for B7 & B8 as this one was meant to be SMBUS so I wanted different settings just incase I needed them. I don't think it is a problem with the target device (I have attached it anyway, I have two of these on the design with the same clock, data and alert).

Thanks