Page 1 of 1

I2C LCD

Posted: Fri May 04, 2018 1:49 pm
by siliconchip
hi all i tried playing with a I2C driver on a 4x20 lcd and eventually got it working, im now trying to use the same principle to run a 2x16 lcd and made a short but sweet flowchart to test but in simulation seems to work but wont compile and i cant understand why HELP

Re: I2C LCD

Posted: Fri May 04, 2018 5:41 pm
by Benj
Hello,

You shouldn't need the I2C Master component in your project. This is setting the pins C3 and C4 up into I2C master hardware mode and this is then locking out the display component which is setup for software mode on the same pins.

Try this and see how you get on.
oi i2c.fcfx
(8.01 KiB) Downloaded 261 times

Re: I2C LCD

Posted: Fri May 04, 2018 5:59 pm
by siliconchip
hi benj
thanks for the reply, ive tried to compile this again and get the following

cheers bob
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
520: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
521: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
522: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
523: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
524: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
534: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
536: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
538: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
540: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
570: FCP_SET(FCP_NULL, 1);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
583: FCP_SET(FCP_NULL, 1);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
587: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
593: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
594: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
595: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
596: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
597: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
600: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
602: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
604: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
606: FCP_SET(FCP_NULL, (FCL_NIBBLE & 0x01));
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
611: FCP_SET(FCP_NULL, 1);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
619: FCP_SET(FCP_NULL, 1);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
623: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
667: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
668: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
669: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
670: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
671: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
672: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
oi i2c.c: FCD_04071_LCD__RawSend()
519: FCP_SET_FCP_NULL(0, , , );
^ (361) function declared implicit int (warning)
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
520: FCP_SET_FCP_NULL(0, , , );
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
521: FCP_SET_FCP_NULL(0, , , );
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
522: FCP_SET_FCP_NULL(0, , , );
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
523: FCP_SET_FCP_NULL(0, , , );
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
524: FCP_SET_FCP_NULL(0, , , );
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
534: FCP_SET_FCP_NULL((FCL_NIBBLE & 0x01), , , );
(195) expression syntax ^
(194) ")" expected ^
oi i2c.c: 534: too many errors (21)
(908) exit status = 1
(908) exit status = 1
D:\flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

Re: I2C LCD

Posted: Fri May 04, 2018 6:05 pm
by Benj
Hello,

Can you check the lcd_I2C component properties to ensure the pin connections are valid. Looks like you might have an unconnected pin?

If this doesn't work then try flicking the component properties e.g. from hw to sw mode and back.

If this doesn't work then try this.

Click View -> Component Debugger
Tick the "Expose full component tree" checkbox
In the properties window use the drop down menu at the top of the window.
Find the LCD component in the list
Assign pin connections to the various pins, these are not used but need to be valid for the compiler to compile the code.
Remember to untick the component debugger checkbox when you're finished.

Re: I2C LCD

Posted: Fri May 04, 2018 6:20 pm
by siliconchip
hi benj,
thanks for the reply ive tried your suggestions but still will not compile, i recently upgraded to 7.3 and im wondering if this is anything to do with it ???

Re: I2C LCD

Posted: Fri May 04, 2018 7:03 pm
by siliconchip
hi ive just gone on another computer and tried to compile a flowchart that worked using I2C and compiled ok some months ago but this has now the same errors the only difference is that ive updated flowcode to 7.3 on both laptops is there a possible bug ???

Re: I2C LCD

Posted: Mon May 07, 2018 5:10 am
by siliconchip
hi all looking through the bug reports it seems that a few people have also had various issues since upgrading to 7.3, can anyone shed any light on this as to my current problem and how do i reinstall version 7.2 to test this theory

cheers bob

Re: I2C LCD

Posted: Tue May 08, 2018 4:47 pm
by Benj
Hi Bob,

Have you applied the updates available here.
viewtopic.php?f=63&t=19743

I believe the I2C LCD was fixed as part of these.

Let us know how you get on.

Re: I2C LCD

Posted: Wed May 09, 2018 5:29 pm
by siliconchip
hi benj,
ive just added the updates and it now seems to be compiling brilliant big thanks

regards bob