I2C Pin selection problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

I2C Pin selection problem

Post 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
Attachments
dsPIC33EP.pdf
(4.69 MiB) Downloaded 211 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C Pin selection problem

Post 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?

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: I2C Pin selection problem

Post 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
Attachments
EMC1412.pdf
(1.01 MiB) Downloaded 196 times

Post Reply