Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I2C 18F4550
02-05-2013, 12:44 AM,
#1
I2C 18F4550
good day,
has anybody had any luck with I2c working on the pic18f4550? i have tried the I2c lcd with PCF8574T LCM602 IIC.

thanks
fredHuh
Reply
11-03-2014, 11:56 AM,
#2
RE: I2C 18F4550
(02-05-2013, 12:44 AM)derf158 Wrote: good day,
has anybody had any luck with I2c working on the pic18f4550? i have tried the I2c lcd with PCF8574T LCM602 IIC.

thanks
fredHuh

Hello Fred,
Did you solve your problem ?
I had the same one.
The lcd + pcf8574 worked on an Arduino and did not on a 18f4550 pinguino.
I just find why.
I thought there were pullup resistors integrated to the i2c pcf8574 module for the SDA and SCL lines.
I was wrong. I added these 2 resistors and now it works.
Perhaps you met the same case ?!
André
Reply
01-11-2015, 09:04 PM, (This post was last modified: 01-11-2015, 09:12 PM by derf158.)
#3
RE: I2C 18F4550
(11-03-2014, 11:56 AM)gtcbreizh Wrote:
(02-05-2013, 12:44 AM)derf158 Wrote: good day,
has anybody had any luck with I2c working on the pic18f4550? i have tried the I2c lcd with PCF8574T LCM602 IIC.

thanks
fredHuh

Hello Fred,
Did you solve your problem ?
I had the same one.
The lcd + pcf8574 worked on an Arduino and did not on a 18f4550 pinguino.
I just find why.
I thought there were pullup resistors integrated to the i2c pcf8574 module for the SDA and SCL lines.
I was wrong. I added these 2 resistors and now it works.
Perhaps you met the same case ?!
André
André
what size resistor did you put on your SCL & SDA i still can not get my I2C lcd toy work.this is the code i am using from the example folder.
thank you
fred
Code:
u16 i=0;

void setup()
{
   // PCF8574  : slave adress is 0 1 0 0 A2 A1 A0
   // PCF8574A : slave adress is 0 1 1 1 A2 A1 A0
   lcdi2c.init(16, 2, 0x27);           // display is 2x16, ic2 address is 0100111 (see above)
   lcdi2c.backlight();                 // turns backlight on
   lcdi2c.clear();                     // clear screen
   lcdi2c.home();                      // set cursor at (0,0)
   lcdi2c.printf("   lcdi2c demo  ");
}

void loop()
{
   lcdi2c.setCursor(0, 1);                    // set cursor at line 1, col 0
   lcdi2c.printf("i=%u ", i++);
   delay(500);
}
Reply
01-11-2015, 09:54 PM,
#4
RE: I2C 18F4550
Hello Fred,
I hope tomorrow I shall be able to test your code. It is a long time I tested an I2c LCD module !
Bye
André
Reply
01-11-2015, 10:40 PM,
#5
RE: I2C 18F4550
(01-11-2015, 09:54 PM)gtcbreizh Wrote: Hello Fred,
I hope tomorrow I shall be able to test your code. It is a long time I tested an I2c LCD module !
Bye
André
André
thank you 
fred
Reply
02-11-2015, 06:53 PM, (This post was last modified: 02-11-2015, 07:14 PM by gtcbreizh.)
#6
RE: I2C 18F4550
Hello Fred,
At last I got 2 modules i2c-LCD which work.
The first one is self-made PCF8574 module with a transistor-controlled Backlight + a potentiometer to control the contrast. Further it integrates 2 pullup resistors powered either with 5V, either with 3.3V according I work with a 18f4550 or a 18f47j53 controller. The LCD is directly plugged into the module.
The second one is composed of a chinese PCF8574 module (brand :  mjkdz; I2C address=0x20 but it can be 0x20 to 0x27) which integrates a potentiometer and a backlight control. The LCD is connected to the i2c module by a ribbon cable.
N.B. The SDA and SCL pins (RB0, RB1) are firstly connected to a 5V source thru 2.2K ohm resistor and secondly to the SDA and SCL pins on the I2C module.

To help you I need to know what is your I2C module because the connexions between the PCF8574 and the LCD are different according the I2C module. I identified 4 configurations.

What IDE version do you use, what date or release # ?
I am waiting your replies.
Bye
André
Reply
03-11-2015, 01:34 AM, (This post was last modified: 03-11-2015, 01:37 AM by derf158.)
#7
RE: I2C 18F4550
(02-11-2015, 06:53 PM)gtcbreizh Wrote: Hello Fred,
At last I got 2 modules i2c-LCD which work.
The first one is self-made PCF8574 module with a transistor-controlled Backlight + a potentiometer to control the contrast. Further it integrates 2 pullup resistors powered either with 5V, either with 3.3V according I work with a 18f4550 or a 18f47j53 controller. The LCD is directly plugged into the module.
The second one is composed of a chinese PCF8574 module (brand :  mjkdz; I2C address=0x20 but it can be 0x20 to 0x27) which integrates a potentiometer and a backlight control. The LCD is connected to the i2c module by a ribbon cable.
N.B. The SDA and SCL pins (RB0, RB1) are firstly connected to a 5V source thru 2.2K ohm resistor and secondly to the SDA and SCL pins on the I2C module.

To help you I need to know what is your I2C module because the connexions between the PCF8574 and the LCD are different according the I2C module. I identified 4 configurations.

What IDE version do you use, what date or release # ?
I am waiting your replies.
Bye
André
André
I hooked this up to my arduino and did the I2C scan and the serial shown address 0x27
Pinguino IDE v11

Last update : 06-07-2015
PCF8574T


THANK YOU
FRED
Reply
03-11-2015, 12:05 PM,
#8
RE: I2C 18F4550
Hello Fred,
I attached new files lcdi2c.c lcdi2c.h to replace the ones located in P8\include\pinguino\libraries.
Then modifie your lcdi2c.pde replacing
 lcdi2c.init(16, 2, 0x27); // display is 2x16, ic2 address is 0100111 (see above)

 
by
lcdi2c.init(16, 2, 0x27,4,2,1,0,3);//Dfrobot module, here P4-P7 are connected to D4-D7
// number of characters per line, number of lines, expander I2C address, first expander pin position to receive D4-D7 LCD data, positions to En, RW, RS, Backlight

I attach a photo to show the kind of module I used. The I2C module was sold already soldered to the LCD. Don't forget the resistors.
N.B. This I2C module is different of the mjkdz module of which I early spoke !!!

Verify with a multimeter how are your connections between the expander P0-P7 pins and the LCD and if necessary change the lcdi2c.init call.
Bye
André


Attached Files Thumbnail(s)
   

.c   lcdi2c.c (Size: 15.51 KB / Downloads: 19)
.h   lcdi2c.h (Size: 8.77 KB / Downloads: 12)
Reply
03-11-2015, 01:09 PM,
#9
RE: I2C 18F4550
(03-11-2015, 12:05 PM)gtcbreizh Wrote: Hello Fred,
I attached new files lcdi2c.c lcdi2c.h to replace the ones located in P8\include\pinguino\libraries.
Then modifie your lcdi2c.pde replacing
 lcdi2c.init(16, 2, 0x27); // display is 2x16, ic2 address is 0100111 (see above)

 
by
lcdi2c.init(16, 2, 0x27,4,2,1,0,3);//Dfrobot module, here P4-P7 are connected to D4-D7
// number of characters per line, number of lines, expander I2C address, first expander pin position to receive D4-D7 LCD data, positions to En, RW, RS, Backlight

I attach a photo to show the kind of module I used. The I2C module was sold already soldered to the LCD. Don't forget the resistors.
N.B. This I2C module is different of the mjkdz module of which I early spoke !!!

Verify with a multimeter how are your connections between the expander P0-P7 pins and the LCD and if necessary change the lcdi2c.init call.
Bye
André
André
 i will give this a try tonight.
thank you 
fred
Reply
05-11-2015, 01:12 AM,
#10
RE: I2C 18F4550
(03-11-2015, 01:09 PM)derf158 Wrote:
(03-11-2015, 12:05 PM)gtcbreizh Wrote: Hello Fred,
I attached new files lcdi2c.c lcdi2c.h to replace the ones located in P8\include\pinguino\libraries.
Then modifie your lcdi2c.pde replacing
 lcdi2c.init(16, 2, 0x27); // display is 2x16, ic2 address is 0100111 (see above)

 
by
lcdi2c.init(16, 2, 0x27,4,2,1,0,3);//Dfrobot module, here P4-P7 are connected to D4-D7
// number of characters per line, number of lines, expander I2C address, first expander pin position to receive D4-D7 LCD data, positions to En, RW, RS, Backlight

I attach a photo to show the kind of module I used. The I2C module was sold already soldered to the LCD. Don't forget the resistors.
N.B. This I2C module is different of the mjkdz module of which I early spoke !!!

Verify with a multimeter how are your connections between the expander P0-P7 pins and the LCD and if necessary change the lcdi2c.init call.
Bye
André
André
 i will give this a try tonight.
thank you 
fred
André
still working on it with no luck yet . but i will not give up.
thank you
fred
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)