issue using LCD with I2C backpack

Any bugs you encounter with Flowcode should be discussed here.
peterhalloway
Posts: 25
http://meble-kuchenne.info.pl
Joined: Sat Nov 20, 2021 11:28 am
Has thanked: 1 time

Flowcode v10 issue using LCD with I2C backpack

Post 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
Attachments
PICBOT test.fcfx
(9.16 KiB) Downloaded 83 times

chipfryer27
Valued Contributor
Posts: 1374
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 331 times
Been thanked: 479 times

Re: issue using LCD with I2C backpack

Post 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

medelec35
Matrix Staff
Posts: 1665
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 581 times
Been thanked: 556 times

Re: issue using LCD with I2C backpack

Post by medelec35 »

Hello.
Many thanks for the report
This is currently being looked into.
I have moved this topic to the bugs section.
Martin

medelec35
Matrix Staff
Posts: 1665
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 581 times
Been thanked: 556 times

Re: issue using LCD with I2C backpack

Post 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.
Martin

peterhalloway
Posts: 25
Joined: Sat Nov 20, 2021 11:28 am
Has thanked: 1 time

Re: issue using LCD with I2C backpack

Post 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.
Attachments
DB.fcfx
(46.63 KiB) Downloaded 52 times

Steve-Matrix
Matrix Staff
Posts: 1416
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 193 times
Been thanked: 331 times

Re: issue using LCD with I2C backpack

Post 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.

peterhalloway
Posts: 25
Joined: Sat Nov 20, 2021 11:28 am
Has thanked: 1 time

Re: issue using LCD with I2C backpack

Post 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
Attachments
PDB V2.zip
(54.57 KiB) Downloaded 39 times
DB.fcfx
(51.92 KiB) Downloaded 44 times

medelec35
Matrix Staff
Posts: 1665
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 581 times
Been thanked: 556 times

Re: issue using LCD with I2C backpack

Post 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.
Martin

peterhalloway
Posts: 25
Joined: Sat Nov 20, 2021 11:28 am
Has thanked: 1 time

Re: issue using LCD with I2C backpack

Post 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

medelec35
Matrix Staff
Posts: 1665
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 581 times
Been thanked: 556 times

Re: issue using LCD with I2C backpack

Post 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.
Martin

Post Reply