Page 1 of 2

issue using LCD with I2C backpack

Posted: Fri Nov 29, 2024 3:45 am
by peterhalloway
After a break I have comeback to flowcode, upgraded to V10 . I dug out an old board I'd designed which uses a 16F690. I added the usual LED as all i wanted to do is test the ICSP was working and it seemed fine. So I then decided to try a 20x4 LCD (with I2C backpack) just wrote my name on it. I changed the address to 27. When I tried to program it cane back with this:

Using <PICkit2 PK2CMD External Power> inbuilt settings for compiler
Launching the compiler...
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PIC\batch\pic_xc8_comp.bat "C:\Program Files (x86)\Flowcode\Common\Compilers\picv2\" 16F690 "C:\Users\peter\Documents\flowcode\" "PICBOT test"
C:\Users\peter\Documents\flowcode>REM CRC: 90CF26913586BBA787FE92D553771933222DCF72B25FEB4608E17FBD060500D8A6D7AF8357042D9E8B5C2E833010A32BE2214988CBC1BB00301ECF6745983589807C95A2F1C2769D70BE3AA931A3F48B38E582CFD8E4085DD8DA408700E5719BB0FE44B686FBBF4050CACCEB0B5A8E521002EAF3D15174CD20633AD186EC562DBEEF6112EA5AA5CF5041CCE14E8D252BC416ECB8EC7761E4FD518969900F56C6C8F36CE7BEFFD91E73F563CBE7F64B8A69F01B3F3C0F45102C3050DA273BE4EE1468065B86E00B2487B7DE8D413948019019AFB8908E26D0AE50ACE3D7DDA2D28E9421B336835453
C:\Users\peter\Documents\flowcode>REM REVISION: 3.0
C:\Users\peter\Documents\flowcode>REM GUID: 50CB4B58-ED9C-4591-8D65-A87DE810E8CC
C:\Users\peter\Documents\flowcode>REM DATE: 09\01\2024
C:\Users\peter\Documents\flowcode>REM DIR: FCD\PIC\batch\pic_xc8_comp.bat
C:\Users\peter\Documents\flowcode>"C:\Program Files (x86)\Flowcode\Common\Compilers\picv2\bin\xc8-cc.exe" -mcpu=16F690 "PICBOT test.c" -w=359,1273,1388 -fno-short-float -fno-short-double -std=c90 -Os
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PIC\PIC_CAL_I2C.c:268:99: error: (103) #error: "This chip does not have Master I2C capability or Flowcode does not currently support it"
(908) exit status = 1
Error returned from [xc8.exe]
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PIC\batch\pic_xc8_comp.bat reported error code 0x1


I then spotted you can also set the address in the component macro but still no joy. I went back to the LED to make sure that was OK and it was.

So I am now wondering is there an issue with the component in flowcode (unlikely) or more likely what schoolboy error have I made?

Any help always appreciated

Pete

Re: issue using LCD with I2C backpack

Posted: Fri Nov 29, 2024 6:36 am
by chipfryer27
Hi

"This chip does not have Master I2C capability or Flowcode does not currently support it"

I looked up the datasheet and the chip does support I2C (Master/Slave). I get the same error so maybe something internal to Flowcode?

Regards

EDIT

Just tried to compile using Software channel and it compiles to Hex OK

Re: issue using LCD with I2C backpack

Posted: Fri Nov 29, 2024 11:27 am
by medelec35
Hello.
Many thanks for the report
This is currently being looked into.
I have moved this topic to the bugs section.

Re: issue using LCD with I2C backpack

Posted: Fri Nov 29, 2024 3:43 pm
by medelec35
Hi Pete.
With 16F690. Microchip changed the way I2C works so its non standard.
So sorry, its not supported even though 16f690 does have master mode.
As chipfryer27 as stated, it compiles in software mode, so its best to use that.

Re: issue using LCD with I2C backpack

Posted: Sat Dec 07, 2024 2:33 pm
by peterhalloway
Hi Martin can you confirm whether the component has a bug. The board I am developing uses a PIC 18F452 when I compile to hex the LCD is not working in the other software I am using (Proteus). I have attached my file I compile it to Hex and attach it to the PIC in proteus.

Thanks

Pete.

Re: issue using LCD with I2C backpack

Posted: Mon Dec 09, 2024 4:29 pm
by Steve-Matrix
Hi Pete,

Have you tried changing to use the 'software mode' for the LCD as suggested by other posters? Your attached project is still using the hardware channel 1 for the I2C connection.

Re: issue using LCD with I2C backpack

Posted: Mon Dec 09, 2024 7:00 pm
by peterhalloway
Hi Steve
I have tried it with both. I have also tried with a 16F877A as my older generation dev board I designed has one of these. I wanted to see if it worked in the real world to see if it was an issue with Proteus. However, it does not seem to work in either proteus or in real world. I am doing a talk on it on Thursday at my local amatuer radio club and was hoping to show it in all its glory. I can show it in simulation but for now it seems I need to avoid using an I2C LCD. Its probably a schoolboy error on my part but I have not had these issues. The address of the LCD is 27 which is what I have entered in properties. I dont have to use $ or # or anything else do I?

I think you guys may use proteus I have added the file also.

Thanks for the help so far
Pete

Re: issue using LCD with I2C backpack

Posted: Tue Dec 10, 2024 10:16 am
by medelec35
Hi Pete.
I have just tried with my I2C LCD on 16F18877 (not got your target device) using your project file.
After changing address to 63 which is my LCD I2C address, all text is correctly displayed.
I have tried I2C on Channel1 and software, works on both.
Do you have a jumper connected to the two pins on the I2C board to light the backlight and have you tried adjusting the contrast trimmer?
If so then what is the chip on the I2C?
Mine is PCF8574AT which has a different address range to just PC8574 without the A

Have you got a a UART to USB bridge or a logic analyser that can show UART values?
If so you can use an I2C address detector/sniffer, to see if hardware is working and to find out the I2C address.

Re: issue using LCD with I2C backpack

Posted: Tue Dec 10, 2024 7:35 pm
by peterhalloway
Hi Martin
it was a schoolboy I was mixing up decimal with hex for the I2C address. Tonight I have an LCD displaying, although the backlight comes on when I first switch on, then immediately turns off!

It is not working in Proteus but thats not your problem!!

Thanks again for your help.

PS I will PM you with some licencing questions

Pete

Re: issue using LCD with I2C backpack

Posted: Tue Dec 10, 2024 11:53 pm
by medelec35
Hi Pete.
You need the jumper across the two pins, to keep the backlight on.
Not a problem with the PM about licences.