I2C Pin selection problem
Posted: Mon Feb 05, 2018 2:12 pm
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
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