I2C DISPLAY PROBS

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

I2C DISPLAY PROBS

Postby siliconchip » Fri Dec 29, 2017 8:16 pm

hi all I'm planning on using a 4x20 display in a future project, and thought that by using an I2C module plugged into the back of the display I could keep lcd wiring down to a minimum, I've done a test flowchart and it works in flowcode but when I use hardware the display stays blank, ive no idea how I2C works and maybe a bit naive on just plugging bits together , I'm not sure if I've got something wrong in software or I need a special lcd etc, any help would be appreciated

cheers in advance
bob
Attachments
4 x 20 display probs.fcfx
(8.9 KiB) Downloaded 56 times

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Sat Dec 30, 2017 11:49 am

morning all
ive been playing around with my program and in the lcd _I2C properties I changed the channel from software to channel 1 and when compiling I get the error messages
209.#error this chip does not have master I2C capability or flowcode does not currently support it
103.#error this chip does not have master I2C capability or flowcode does not currently support it

but if I compile using channel - software it goes through ok, I also changed the address from 32 to 27 which I found for the I2C adapter I have plugged into my lcd on a data sheet but makes no difference the lcd just lights up, do I need to add the I2C component from the tools or comms selection if so do I need master or slave and how would this be set up, or is it that I'm using the wrong chip and how would I find out what pic would be compatible to use with flowcode ?? lots of questions I know but I'm totally in the dark and cant seem to find any thing on this site or on line to help :oops:
bob
These users thanked the author siliconchip for the post:
jgu1 (Sun Dec 31, 2017 9:32 am)
Rating: 5.26%
 

jgu1
Posts: 1126
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1041 times
Been thanked: 275 times
Contact:

Re: I2C DISPLAY PROBS

Postby jgu1 » Sun Dec 31, 2017 9:35 am

Hi Bob!

I have one arduino and a display with I2C ready. Preveiusly I had No problem with this. I Will make a test with your program later today, and you hear.

Br Jorgen.
These users thanked the author jgu1 for the post:
siliconchip (Sun Dec 31, 2017 9:42 am)
Rating: 5.26%
 

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Sun Dec 31, 2017 9:42 am

hi jorgen i would appreciate that thank you

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Sun Dec 31, 2017 4:49 pm

hi,
spent the morning researching the I2C system on the net and from what I understand I have a substantial piece of code missing to get the display working ie I need to initialise ,start and send slave address and data etc but I'm unsure how I would need to send a string message as data etc any help please

bob

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Sun Dec 31, 2017 7:33 pm

hi all
thanks to an article in programming tips and tricks by jay dee from 2016 I found the info I needed regards the I2C controller I have, I needed to set the address in the lcd to match the address in the i2c master I also needed to add and initialise and as jay dee said flowcode does the rest works spot on in hardware plus ive learnt the basics of I2C which cant be bad :D

bob

jgu1
Posts: 1126
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1041 times
Been thanked: 275 times
Contact:

Re: I2C DISPLAY PROBS

Postby jgu1 » Sun Dec 31, 2017 8:44 pm

Hi Bob!

I test your program in FC7.3.05 the latest update, your are right it doesn´t work now. I try to change the chip to an arduino, but it will not compile.
If I remove the display from panel, it will compile ok, so there are a bug with these I2C display.

I started my other PC, with FC7 ver. 7.2 Not updated yet. In this version, your program work fine, no problem, the I2C display work fine. ????
Then I started FC6, and there everything also is ok.

Conclution, after update to 7.3.05, the I2c display is not working. :( Hopefully MM team fix this ASAP.

Happy newyear.

Jorgen
Attachments
I2c.PNG
I2c.PNG (34.98 KiB) Viewed 3323 times

mnf
Valued Contributor
Valued Contributor
Posts: 621
Joined: Wed May 31, 2017 11:57 am
Has thanked: 56 times
Been thanked: 340 times
Contact:

Re: I2C DISPLAY PROBS

Postby mnf » Mon Jan 01, 2018 9:08 am

Hi,

It depends on what i2c port expander is used in the display. I have a 'cheap' Chinese display and it seems to use the PCF8574 port expander to connect i2c to the LCD display's inputs.

I started thinking about creating a component to support this - but it lead me down some twisty passages on the way - see my post about Port Expander MCP230xx in the user components section...

Have a look on your i2c 'backpack' and see what chip it uses..

Martin
These users thanked the author mnf for the post:
siliconchip (Mon Jan 01, 2018 10:16 am)
Rating: 5.26%
 

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Mon Jan 01, 2018 10:15 am

hi martin
I looked at the ic on my i2c backpack and its the same jay dee describes in his write up he also tells you the addresses between 2 different versions with this back pack I followed his write up and my 4x20 works perfectly now

bob
These users thanked the author siliconchip for the post:
mnf (Mon Jan 01, 2018 12:09 pm)
Rating: 5.26%
 

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Mon Jan 01, 2018 10:18 am

hi Jorgen
I got my display to work in the end my issue seemed to be a little more code needed and getting the addresses right I also needed to add the master I2C component, but my seems to be ok now

bob

mnf
Valued Contributor
Valued Contributor
Posts: 621
Joined: Wed May 31, 2017 11:57 am
Has thanked: 56 times
Been thanked: 340 times
Contact:

Re: I2C DISPLAY PROBS

Postby mnf » Mon Jan 01, 2018 12:10 pm

Cool.

Would you be able to post the code?

jgu1
Posts: 1126
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1041 times
Been thanked: 275 times
Contact:

Re: I2C DISPLAY PROBS

Postby jgu1 » Mon Jan 01, 2018 1:57 pm

Hi BOB!

Ok Bob, it is nessesary to add I2c component. In ver. 7.2 you could only add the I2c display to the panel without anything else, and it work.

Strange. Are you running FC7.3.05??? Because after my updating I am not able to use I2c display at all. As mnf said, please would you attack your new program?

And Please, Would you try to compile my testprogram. I think, if you have ver. 7.2 it is ok but if you have ver. 7.3 it not working. And other also, please, to confirm my mistake :wink:

Br jorgen
Attachments
I2C Display Test..fcfx
(7.73 KiB) Downloaded 23 times

siliconchip
Posts: 246
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 72 times
Been thanked: 22 times
Contact:

Re: I2C DISPLAY PROBS

Postby siliconchip » Mon Jan 01, 2018 8:55 pm

hi jorgen and martin
ive added my simple program that got the lcd working, also Jorgen im on version 7.2 for some reason I'm having trouble installing the 7.3 update, Jorgen I have tried compiling your program and it comes back as success hope this helps you both

bob
Attachments
4 x 20 display probs.fcfx
(10.53 KiB) Downloaded 26 times
These users thanked the author siliconchip for the post (total 2):
mnf (Mon Jan 01, 2018 9:28 pm) • jgu1 (Tue Jan 02, 2018 7:44 pm)
Rating: 10.53%
 

jgu1
Posts: 1126
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1041 times
Been thanked: 275 times
Contact:

Re: I2C DISPLAY PROBS

Postby jgu1 » Tue Jan 02, 2018 8:09 pm

Hi Bob!

Thank´s for testing. As I mentioned, the display worked in ver. 2 but not in ver. 3

I have reported a bug, hopefully MM will take a look.

Thanks.

Br. Jorgen.

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

Re: I2C DISPLAY PROBS

Postby Benj » Wed Jan 03, 2018 11:24 am

Hello,

Sorry for this, the problem has come about from adding remappable I2C functionality to the I2C components as used on some of the newer PIC devices.

I have now fixed the component and posted the updated component here.
viewtopic.php?f=64&t=19665&p=85810#p85810
These users thanked the author Benj for the post:
jgu1 (Wed Jan 03, 2018 9:53 pm)
Rating: 5.26%