Slow Graphical LCDs

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Slow Graphical LCDs

Post by Benj »

Hello All,

I have found a way to allow the graphical LCDs to operate much faster in Flowcode 7. It's currently a bit hacky but it is yielding good results. If you have a display which you wished ran faster then let me know which display you're using and which Microcontroller and I'll put together an updated component for you. Testing with the EBM001 display on an 8-bit PIC (ECIO40P @ 48MHz) I got a speed increase of approx 240%.

In the next few days I want to make this a bit less hacky and so it will work more universally with less modification to components.

I have also created a component to allow graphical displays to be used like an alphanumeric component. e.g. to allow text to be streamed to the display with a cursor instead of having to use the coordinate system. It's working well at the moment so assuming all is well in testing I'll post this tomorrow.

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

Re: Slow Graphical LCDs

Post by Benj »

Right as advertised here is a new component to allow for a graphical display to be used as an alphanumeric text field.

SImply copy the file to your "Flowcode 7/Components" folder and restart Flowcode and the new component should be in with the other GLCD components.
TextField.fcpx
(7 KiB) Downloaded 454 times
Here is an example to go with the component.
GLCDTextFieldExample.fcfx
(8.32 KiB) Downloaded 464 times
And finally here is the new Wiki page: http://www.matrixtsl.com/wikiv7/index.p ... 0ef8e57d40

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

Re: Slow Graphical LCDs

Post by Benj »

Here is a new version of the EBM001 component. It should work as was for AVR and ARM targets but should be significantly faster for PIC based devices.

If you have a go then let us know how you get on. Just copy the attached file to your "Flowcode 7/components" folder and restart Flowcode.
gLCD_EBM001.fcpx
(54.88 KiB) Downloaded 448 times
Again if you're using a different display then let me know what and on which Microcontroller and I will see if I can speed it up for you.


Here are some additional extra improvements I have made to the CAL IO files to speed up outputs. I've not found any problems with this speed up yet but again let me know if you try it and find any issues.

These files are added into Flowcode by copying them into the correct CAL folder "Flowcode 7/CAL/FAMILY/" where FAMILY is PIC / PIC16 / PIC32 or AVR.
AVR_CAL_IO.h
(8.8 KiB) Downloaded 410 times
PIC_CAL_IO.h
(10.61 KiB) Downloaded 417 times
PIC16BIT_CAL_IO.h
(5.48 KiB) Downloaded 429 times
PIC32BIT_CAL_IO.h
(5.45 KiB) Downloaded 405 times

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: Slow Graphical LCDs

Post by johnsondav »

Hi Benj

Thank you for the updated files to improve the performance of this LCD display. I would like to confirm the files have made a great improvement. Instead of the suggested EM001 LCD display, I have tested the updated files using the following display:-

1.8 inch 1.8" TFT LCD Display module ST7735S 128x160 V1.1

Everything appears to be working fine. This is great news as these displays are under £5.
ST7735S.jpg
ST7735S.jpg (2.27 KiB) Viewed 15185 times
Excellent work - Many thanks :-)

Speed64
Posts: 39
Joined: Sat Jul 16, 2016 12:08 pm
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Slow Graphical LCDs

Post by Speed64 »

Hi Benj,


Does it also work with an SSD1963 and PIC32MX470F512?

Can the driver be extended for 16-bit data lines in the wiring?
This makes it faster overall.

I can give you a display + PIC for it.



Sincerely
Speed64

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

Re: Slow Graphical LCDs

Post by Benj »

Hello,

Here is an updated component for the SSD1963 which should hopefully make it run faster on a PIC device.
glcd_SSD1963.fcfx
(123.59 KiB) Downloaded 477 times
16-bit data lines would certainly make a difference. I'll add it to the list to investigate this.

Let me know how you get on.

Speed64
Posts: 39
Joined: Sat Jul 16, 2016 12:08 pm
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Slow Graphical LCDs

Post by Speed64 »

Hi Benj.

Is it correct that both files are equal?

PIC16BIT_CAL_IO.h / PIC32BIT_CAL_IO.h



Sincerely
Speed64

Speed64
Posts: 39
Joined: Sat Jul 16, 2016 12:08 pm
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Slow Graphical LCDs

Post by Speed64 »

Hi Benj,

Error Code?

Target folder: C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1
Source name: C:\Users\Uwe\Documents\Flowcode7\Projekte\SSD1963 neu\glcd_SSD1963_ PIC32.fcfx
Device: PIC32.32MX.32MX470F512L
Generated by: Flowcode v7.1.1.0
Date: Monday, November 21, 2016 21:17:58
Registered to: Uwe kapuschinski
Licence key: PMCWGA
NICHT FÜR KOMMERZiELLE ANWENDUNGEN
http://www.matrixtsl.com
Start des Compilers...
E:\Program Files (x86)\Flowcode 7\compilers\pic32\bin\xc32-gcc.exe -mprocessor=32MX470F512L -O1 -o "C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.out" "C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c"
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c: In function 'FCM_LCD_Write_Data':
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:564:2: error: 'LCDRSPIN' undeclared (first use in this function)
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:564:2: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:88:27: error: '__PORTCbits_t' has no member named 'RC0'
#define LCDCSPIN PORTCbits.RC0
^
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:751:2: note: in expansion of macro 'LCDCSPIN'
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:88:27: error: '__PORTCbits_t' has no member named 'RC0'
#define LCDCSPIN PORTCbits.RC0
^
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:763:2: note: in expansion of macro 'LCDCSPIN'
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c: In function 'FCM_Initialise':
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:2803:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:2892:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
FCV_BB = 16777215 / 65536;
C:\Users\Uwe\DOCUME~1\FLOWCO~1\Projekte\SSD196~1\glcd_SSD1963_ PIC32.c:2893:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
E:\Program Files (x86)\Flowcode 7\compilers\pic32\bin\xc32-gcc.exe Hat den Fehlercode 255 gemeldet




Sincerely
Speed64

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

Re: Slow Graphical LCDs

Post by Benj »

Hello,

Please can you attach your project and I'll investigate for you.

Speed64
Posts: 39
Joined: Sat Jul 16, 2016 12:08 pm
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Slow Graphical LCDs

Post by Speed64 »

Hi Benj,


This is just the file "glcd_SSD1963_ PIC32.fcfx"
Converted to PIC32MX470F512L

The original makes this mistake
###############################################################
Target folder: C:\Users\Uwe\AppData\Local\Temp
Source name: C:\Users\Uwe\AppData\Local\Temp\glcd_SSD1963.fcfx
Title:
Description:
Device: PIC.16F.16F877A
Generated by: Flowcode v7.1.1.0
Date: Tuesday, November 22, 2016 18:17:13
Users: 1
Registered to: Uwe kapuschinski
Licence key: PMCWGA
NICHT FÜR KOMMERZiELLE ANWENDUNGEN
http://www.matrixtsl.com
Start des Compilers...
E:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=16F877A "glcd_SSD1963.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.38
Build date: Jun 30 2016
Part Support Version: 1.38
Copyright (C) 2016 Microchip Technology Inc.
License type: Node Configuration

glcd_SSD1963.c: FCM_LCD_Write_Data()
528: LCDRSPIN = 1;
^ (192) undefined identifier "LCDRSPIN"
(908) exit status = 1
(908) exit status = 1

E:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe Hat den Fehlercode 1 gemeldet



BEENDET

###################################################################################


Sincerely
Speed64

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

Re: Slow Graphical LCDs

Post by Benj »

Many thanks for letting me know.

I think I have fixed the problem now.
gLCD_SSD1963.fcpx
(9.59 KiB) Downloaded 355 times

viki2000
Posts: 190
Joined: Mon Jul 07, 2014 9:38 am
Has thanked: 30 times
Been thanked: 77 times
Contact:

Re: Slow Graphical LCDs

Post by viki2000 »

What about GLCD (SH1106) 132x64 SPI 3 and 4 wires and I2C?
viewtopic.php?f=56&t=16595
viewtopic.php?f=56&t=16374
viewtopic.php?f=7&t=16592

Any chance to provide a proper component for that one?

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

Re: Slow Graphical LCDs

Post by Benj »

Hello,

I will investigate creating a component for this for you.

Do you have a display you can send to us so we can speed up creating and testing the component without going back and forth with test files.

viki2000
Posts: 190
Joined: Mon Jul 07, 2014 9:38 am
Has thanked: 30 times
Been thanked: 77 times
Contact:

Re: Slow Graphical LCDs

Post by viki2000 »

Hi Benj,

There are different OLED mini displays 0.96“and 1.3“, that I am aware, so don’t know about bigger sizes, which are using the SH1106 controller. For example I have SainSmart 1.3" SPI and Waveshare 0.96” SP/I2C both displays with SH1106. I will provide below more info.

There is no problem for me to send you one such displays, so you can have it in your hands and test it directly. But instead of sending one, I prefer to buy one for you directly from Ebay.co.uk , for example here: https://goo.gl/qT8ObQ
Please provide me with a name and address wher should be sent the display. You may send me the contact info in a private message if is not for public.

Few things to know about this SH1106.
Waveshare OLED displays has nice info about them:
http://www.waveshare.com/wiki/1.3inch_OLED_(B)
http://www.waveshare.com/wiki/OLED_Datasheets
With the datasheet of the SH1106 here:
http://www.waveshare.com/w/upload/5/5e/SH1106.pdf

Personally I have tested and worked fine with these SH1106 displays using PIC18F and Arduino. I can provide diagrams, photos and videos about the tests. A part of them you may see in my 3 links above from previous reply.
There are C libraries for both PIC and Arduino. We just need a component for Flowcode. If you need them I can provide them.

One thing is clear: it does not matter what colour is the display (except if it is RGB), it does not matter its size (0.96” or 1.3”) as long has the same resolution and has the same SH1106 then the control is the same.

Basically the controller SH1106 is similar with SD1306 with some differences as: main difference 132x64 pixels for SH1106 instead of 128x64 for SD1306, maybe some other functions as scroll may not work, the initialization may be different.
Because of 132x64 instead of 128x64, if it is used as replacement 1:1 with SD1306 GLCD component in Flowcode, then there are some vertical lines on the right side, because the graphic is not centred.
A bit more info here: https://forum.arduino.cc/index.php?topic=256374.0
Adafruit made a library for it to work in Arduino, but are other libraries too: https://github.com/wonho-maker/Adafruit_SH1106

I do not want to “bombard” you with too much info, but if need more, I can provide.
Now I am waiting for your contact info to send you one such display.

viki2000
Posts: 190
Joined: Mon Jul 07, 2014 9:38 am
Has thanked: 30 times
Been thanked: 77 times
Contact:

Re: Slow Graphical LCDs

Post by viki2000 »

It just happened to have a TFT 1.8“ display, bought few months ago from gearbest.com (http://www.gearbest.com/lcd-led-display ... tml?wid=21), similar with the one from picture posted by johnsondav above.
It has ST7735 controller and I wanted to test if the new component proposed by Ben works with Flowcode 6.
And I can confirm it does work.
I never tried it yet with PIC microcontrollers to see if it is faster, but I tried it with Arduino Uno R3 and Flowcode 6.
Attached is the code that I used.
Here is a connecting and test example done by someone else with Arduino IDE: https://www.youtube.com/watch?v=boagCpb6DgY
I placed (replaced):
- the gLCD_EBM001.fcpx component in C:\Program Files (x86)\Flowcode 6\components
- the AVR_CAL_IO.h, PIC_CAL_IO.h, PIC16BIT_CAL_IO.h in their corresponding subfolder from C:\Program Files (x86)\Flowcode 6\CAL
Then I modified the program as attached and was compiled and transferred without errors to Arduino.

I do not know where I shall place PIC32BIT_CAL_IO.h file in Flowcode 6.
Do you have any suggestions?

The new component TextField.fcpx does not work for me, that’s why I had to modify the FlowCode given example.
I receive the message below:
GLCD Textfiled license.jpg
GLCD Textfiled license.jpg (19.43 KiB) Viewed 14510 times
Why? Because TextField.fcpx component was made for Flowcode 7 and I use Flowcode 6?
FC6_1.8TFT_ST7735.fcfx
(6.83 KiB) Downloaded 289 times
Can you test the TextField.fcpx component and modify it to work also with FlowCode 6?

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

Re: Slow Graphical LCDs

Post by Benj »

Hello,

The textfield component is a new development and relies on existing v7 gLCD modifications so is not currently compatible with Flowcode 6 and unfortunately would be a fairly significant amount of work to make it so.

Here are two new SH1106 compatible components for Flowcode 7. Both require the displays component pack and comms pack A.
gLCD_SH1106_I2C.fcpx
(31.87 KiB) Downloaded 282 times
gLCD_SH1106_SPI.fcpx
(33.19 KiB) Downloaded 283 times
Any problems let me know.

Post Reply