Maker Pro
Maker Pro

I2C on PIC16F1937

Horn

Jun 4, 2012
42
Joined
Jun 4, 2012
Messages
42
Ok I am trying to interface a small LCD screen to my PIC16F1937 using I2C to send the data. My data sends fine along the SDA line when I use the original 5V from a USB power supply but that voltage is too high for my LCD. I have decided to use the low drop out voltage (LDO) that is included with this PIC to drop the voltage. It does drop my voltage to a level of 3V which is golden. However activating this one pin (RA0) drops my SDA line down to 3V as well but my SCL line remains near 5V. I have external pull-up resistors connected to both (22K) but on powering up my board I have measured that the resistance on the SCL line is zero. Could this be the problem to why my SCL voltage is so high? If so how did that happen and how do I fix this?
 

Horn

Jun 4, 2012
42
Joined
Jun 4, 2012
Messages
42
I'm very sorry about that I'm pulling them up to 3V.
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
If your entire board is at 3v then there is no way it can be 5v... Double check all your supply lines, I suspect you will find a 5v one in the mix coming from the USB port that is feeding that higher voltage to that pin...
 

Horn

Jun 4, 2012
42
Joined
Jun 4, 2012
Messages
42
The entire board is not at 3V. I'm a bit confused as to what my config bit did exactly. When VCAPEN is off the board operates at 5V. But when I change off to RA0 Most of my I/O drop to 3V and I am using RA0 as the power source for the LCD along with its VLCD. So this RA0 is what I am using as a hub and pulling my SCL and SDA up to it. My output for the SCL from my PIC is 5V and my output for SDA is 3V. I'm not sure why setting VCAPEN to RA0 changed some things and not others. My 5V USB power is tied to the PIC but not to my hub I created.
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
The entire board is not at 3V. I'm a bit confused as to what my config bit did exactly. When VCAPEN is off the board operates at 5V.

The PIC16F193X has an internal Low Dropout
Regulator (LDO) which provides operation above 3.6V.
The LDO regulates a voltage for the internal device
logic while permitting the VDD and I/O pins to operate
at a higher voltage.
There is no user enable/disable
control available for the LDO, it is always active. The
PIC16LF193X operates at a maximum VDD of 3.6V and
does not incorporate an LDO.
A device I/O pin may be configured as the LDO voltage
output, identified as the VCAP pin.
Although not
required, an external low-ESR capacitor may be connected
to the VCAP pin for additional regulator stability.
The VCAPEN<1:0> bits of Configuration Word 2 determines
which pin is assigned as the VCAP pin.

I am using RA0 as the power source for the LCD along with its VLCD.

A single pin should not be supplying the LCD directly, it can only source sink 25mA give or take...

You need to get a 3v supply if you want to run things at 3v, or use a level shifter between devices...

Take some time to review the datasheet...
 

Horn

Jun 4, 2012
42
Joined
Jun 4, 2012
Messages
42
Exactly the problem. I was using the pin as a power source. This is specifically mentioned in the data sheet. Thank you a lot CocaCola I know have a working board.
 
Top