# Input output voltage problem in PIC32 starter kit & IO expansion board

I have a PIC32 Ethernet Starter kit and IO expansion board. I have a made a simple input output program in which if PINC2 is high then make PINC1 high else low. I have a circuit which gives me a output voltage of 3.3v and I am applying this voltage as input to PINC2. But there is voltage problem at PINC1.

When PINC2 is low, voltage at PINC1 = 3.276v

When PINC2 is high, voltage at PINC1 = 2.8-2.9

My question is when voltage at PINC2 is low, why voltage at PINC1 is 3.276v, it should be 0volts. and when voltage at PINC2 is high, why voltage at PINC1 is 2.8-2.9v, it should be 3.276v. I am really confused at this. Please help

CODE:

int main()
{

TRISCbits.TRISC1=0; //output
TRISCbits.TRISC2=1; //input
while(1)
{

if(PORTCbits.RC2==1)
{

PORTCbits.RC1=1;
}
else if(PORTCbits.RC2==0)
{

PORTCbits.RC1=0;
}
}
}


Link to circuit giving 3.3v output

• what is the actual measured voltage at PINC2 when high and low? Are there any other connections to PINC2 other than opto-coupler output? Any other connections to PINC1 (pullup/pull down/ other circuitry)? Does the circuit work without opto? (Driving PINC2 from 3 .3 V supply directly?) Lastly, can you pls independently check that whether you are indeed driving the PINC1 high and low..Try toggling it directly in the code? – Umar Aug 11 '15 at 12:51
• 1) actual measured voltage at PINC2 at low=0.75 & how can I measure it at high becuase I am applying 3.3v from couplers. 2)no connections at PINC2. 3)no connections at PINC1,but dont know about pull down/high as it is IO expansion board.When there is nothing it is 3.276v so maybe it is pull up. 4)yes it work without optocoupler, I made a program of switch and led and it works. 5) yes it is working – Aircraft Aug 11 '15 at 13:03
• pls isolate the PinC2 and measure the high and low output voltage levels using a DMM. Also, pls post the high and low values when you connect PinC2 to opto. – Umar Aug 11 '15 at 15:01