3C : LCD I2C

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: 3C : LCD I2C

Post by Dan81 »

Hello Milek

3.9K is OK. Keep (for now) WDT OFF.

May be, you can test the PCF with some Led and resistor between +5V and Outputs.
Test the file (just flashing led), if it is not OK , may a trouble with the I2C address.

Is it a PCF8574 or PCF8574A, A0 A1 A2 are really connected to gnd ?
Can you take a look with an oscilloscope on lines SCL and SDA ?

Daniel
Attachments
I2C_test_Led.fcf_avr
Not Hard tested
(28.69 KiB) Downloaded 916 times

MilekNS
Posts: 8
Joined: Tue Mar 11, 2014 11:09 pm
Has thanked: 1 time
Contact:

Re: 3C : LCD I2C

Post by MilekNS »

Dan81 wrote:Hello Milek

3.9K is OK. Keep (for now) WDT OFF.

May be, you can test the PCF with some Led and resistor between +5V and Outputs.
Test the file (just flashing led), if it is not OK , may a trouble with the I2C address.

Is it a PCF8574 or PCF8574A, A0 A1 A2 are really connected to gnd ?
Can you take a look with an oscilloscope on lines SCL and SDA ?

Daniel
Hi Dan

just tested, no leds blinking.
PCF8574T (nxp)
a0,a1,a2 = GND 100%
i have attached my pcb design files, if You have eagle CAD You may take a look but i checked design several times and i don't see any errors.

*note: one jumper is to turn back light ON all the time (ignoring npn transistor and P7 state ) and another one is to connect RW (lcd) to GND ignoring connection with P5 state. that's something i have added as option and it doesn't change anything if not used.
I don't have an oscilloscope :)
Attachments
lcd.rar
(45.56 KiB) Downloaded 939 times

KevinH
Posts: 19
Joined: Sun Mar 18, 2012 9:00 pm
Has thanked: 8 times
Been thanked: 6 times
Contact:

Re: 3C : LCD I2C

Post by KevinH »

I have looked at the schematic and PCB and nothing stands out as an error.

As you don't have a scope I would check the PCF8574T interface writing a simple program to flash the backlight on and off at 1Hz.
That would at least check out the basic ICD and chip.

KevinH
Posts: 19
Joined: Sun Mar 18, 2012 9:00 pm
Has thanked: 8 times
Been thanked: 6 times
Contact:

Re: 3C : LCD I2C

Post by KevinH »

While surfing the forum to understand I2C and FC I came across this post:
http://www.matrixtsl.com/mmforums/viewt ... ave#p61217
It may not be relevant to your specific issue, but as it was interesting for I2C applications and as a good application note link thought I would post it here.

Mouine
Posts: 10
Joined: Sun May 13, 2012 1:13 pm
Location: France
Contact:

Re: 3C : LCD I2C

Post by Mouine »

Hello,
I tried for a long time to run a 4x20 LCD display with i2c in flowcode v5. I try to redo the above diagram and test but it still doesn't work. Is there a macro to flowcode v5? Could someone help me?

Thank you

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: 3C : LCD I2C

Post by Dan81 »

Hello Mouine

Which flowchart are you using ?
Have you put the pull up on SCL and SDA ?
Can you post a photo of your work?

Daniel

Mouine
Posts: 10
Joined: Sun May 13, 2012 1:13 pm
Location: France
Contact:

Re: 3C : LCD I2C

Post by Mouine »

Dan81 Hello and thank you for your reply,

I used the following flowchart. I have read and applied all the posts but it does not work.
is there a macro to flowcode V5 ? I used pic18F452.

Thanks
Attachments
lcd_mcp.jpg
lcd_mcp.jpg (28.11 KiB) Viewed 12853 times

Post Reply