Page 1 of 1

Creating Custom LCD Characters Flowcode V4 & V5

Posted: Sat Mar 02, 2013 3:17 am
by medelec35
Objective: Create a custom volume display with lowest volume showing a single line, next volume level = 2 lines etc.
Just like this:
Volume 1.png
(3.02 KiB) Downloaded 15702 times
You don't need to add any custom code to LCD component.
Just add code at the beginning of you program in the form of:

Code: Select all

FCD_LCDDisplay0_RAM_Write(Custom char number,row1 data,row2 data,row3 data,row4 data,row5 data,row6 data,row 7data,row 8data);
To obtain correct data values, go to:
http://www.quinapalus.com/hd44780udg.html
Thanks to Steve for this link in his original Flowcode V3 Customized characters on the LC (http://www.matrixmultimedia.com/mmforum ... =26&t=4796)
Make sure 5x8 is selected!
There you will see a green rectangle which represents your LCD character.
(You will also see some more created custom characters).
Click on the parts of the green rectangle to create your custom character.
E.g for just the bottom line (1st character used in volume control Flowchart), just select the bottom line of rectangle:
Volume 2.png
(111.32 KiB) Downloaded 15643 times
Notice the numbers in the 'In decimal:; window?
These are the ,row1 data,row2 data etc and what will will be using in the C code at the beginning of our flowchart.
The 1st custom character will be char 0, second will be 1, 3rd will be 2 etc this is what goes at the Custom char number part of C code just before the ,row data.
I just copied and pasted all the numbers. Its as simple as that. :)
So we now have all the information for the C code box:
For the thinnest line (lowest volume ):

Code: Select all

FCD_LCDDisplay0_RAM_Write(0,0,0,0,0,0,0,0,31);
Don't forget the 1st number is the custom character number which we are calling 0

For the two lines:

Code: Select all

FCD_LCDDisplay0_RAM_Write(1,0,0,0,0,0,0,31,31);
This we are calling custom character 1
etc.
To display the custom character, Just use PrintASCII(custom character number) LCD component
E.g

Code: Select all

PrintASCII(0)
The 0 is the custom character number I mentioned.

Important: Since custom characters use C code, then they will not simulate within Flowcode.
The only solution is to use either hardware of a simulator that works with hex files.
Image of LCD within this post is the Real Pic simulator which is loaded with a hex file generated by attached flowchart.
Also if you see and error message when compiling like this:
error: arguments of 'FCD_LCDDisplay0_RAM_Write' don't match the parameters of call
This is because there should be a total of 9 numbers.
The char number + 8 Data numbers. Check that 5 by 8 is selected and not 5 by 7.

Now you can see how easy it is to make custom LCD character your no longer restricted to character sets pre-loaded into LCDs.
I would recommend creating a maximum number of 31 as I believe anymore could interfere with the standard LCD characters.

Another example involving a 'Play' symbol can be found here:
http://www.matrixmultimedia.com/mmforum ... 982#p45592

Martin

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Sat Mar 02, 2013 10:52 am
by brandonb
wow, thats really cool, try this to see what i think of it

Code: Select all

FCD_LCDDisplay0_RAM_Write(0,14,31,0,10,0,17,14,0);
i had no clue it was that easy in flowcode, after i read the web link i have a quicker way of generating the number code!
download mikroc free version, there is a custom lcd char creation under tools, can click on the dots that you want to be on and generate code for it, the code that it gives just add the char# before the first one and whahlah
... oops, here is flowchart
custom characters.fcf
(7.5 KiB) Downloaded 1357 times

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Sat Mar 02, 2013 11:44 am
by medelec35
Thanks Brandon :)
brandonb wrote: after i read the web link i have a quicker way of generating the number code!
download mikroc free version, there is a custom lcd char creation under tools, can click on the dots that you want to be on and generate code for it, the code that it gives just add the char# before the first one and whahlah
Tried that method and it works really well!

I was just trying to find a link where no downloading was required. :)

brandonb wrote:wow, thats really cool, try this to see what i think of it
Brandons custom char.png
(68.25 KiB) Downloaded 15679 times
Very clever :lol:


Martin

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Wed Sep 11, 2013 9:40 pm
by medelec35
Update.
For forward compatibility rather than use a c box with :
FCD_LCDDisplay0_RAM_Write(0,14,31,0,10,0,17,14,0);
It will be best to used LCD function:
Custom component.png
(80.32 KiB) Downloaded 14769 times
Thanks to Ben for posting a flowchart with RAM_Write LCD function.

Martin

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Sat Jul 02, 2016 9:37 am
by George_B
Hello to all!


Using Flowcode 6, I was trying to add a few custom characters into the LCD as medelec35 presented above.

I managed to add some custom characters but after adding the 9th character i am facing a problem. The problem is that instead of the character number 9 the LCD shows a random character from address 0 to 9.

Is there any limitation of the number of custom characters that someone can add?



Thanks in advance
George

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Sat Jul 02, 2016 12:14 pm
by EtsDriver
George_B wrote:Hello to all!


Using Flowcode 6, I was trying to add a few custom characters into the LCD as medelec35 presented above.

I managed to add some custom characters but after adding the 9th character i am facing a problem. The problem is that instead of the character number 9 the LCD shows a random character from address 0 to 9.

Is there any limitation of the number of custom characters that someone can add?



Thanks in advance
George
Hi!

On the Bert Van Dam's book "Create 30 PIC microcontroller projects with FLOWCODE 6" he states that the LCD controller on LCD eblock has only 8 custom user defineable character spaces. (HD48770) It really depends on your LCD manufacturer which parts you can poke, but usually i think all are open to edit all characters, but dont blame me if you mess your lcd up with it... But usually eight are free. The custom chracters are really just downloaded over "control codes" that are ususally meant to not show up. The last (255) should always be left untouched.

The eight custom charactes are located this way in memory according to the book:

ASCII | LCD MEMORY ADDRESS | DISPLAY COMMAND
0 | 64 | PrintASCII(0)
1 | 72 | PrintASCII(1)
2 | 80 | PrintASCII(2)
3 | 88 | PrintASCII(3)
4 | 96 | PrintASCII(4)
5 | 104 | PrintASCII(5)
6 | 112 | PrintASCII(6)
7 | 120 | PrintASCII(7)

Hitachi datasheet:
http://fab.cba.mit.edu/classes/863.06/11.13/44780.pdf
hitachidata1.JPG
(149.07 KiB) Downloaded 3039 times
hitachidata2.JPG
(177.45 KiB) Downloaded 3039 times
I personally use almost always the A02 mapped lcd's, so i have never had a play with that custom character system. :D

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Thu Dec 06, 2018 1:02 am
by ncc1502
Hi Martin,

Do you know how this should be done in Flowcode 6?

If I compile your program I get errors:
Volume Up Down_v6.c(686:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(686:2): error: failed to generate expression
Volume Up Down_v6.c(687:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(687:2): error: failed to generate expression
Volume Up Down_v6.c(688:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(688:2): error: failed to generate expression
Volume Up Down_v6.c(689:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(689:2): error: failed to generate expression
Volume Up Down_v6.c(690:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(690:2): error: failed to generate expression
Volume Up Down_v6.c(691:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(691:2): error: failed to generate expression
Volume Up Down_v6.c(692:2): error: unknown identifier 'FCD_LCDDisplay0_RAM_Write'
Volume Up Down_v6.c(692:2): error: failed to generate expression
Volume Up Down_v6.c success

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Thu Dec 06, 2018 1:34 am
by ncc1502
I do not understand how you convert the numbers you want to display to the ram write box (in your picture).

What should I use if I want to display 14,31,27,21,23,21,27,14, so FCD_LCDDisplay0_RAM_Write(0,14,31,27,21,23,21,27,14);

Re: Creating Custom LCD Characters Flowcode V4 & V5

Posted: Thu Dec 06, 2018 10:30 am
by medelec35
ncc1502 wrote:Do you know how this should be done in Flowcode 6?
You need to follow this updated post and not compile the original flowchart.
Judging by EtsDriver post, you can only use 8 custom characters.