Page 1 of 1

Help to create a gLCD_KS0108 variant

Posted: Wed Sep 11, 2013 2:24 pm
by Crenwick
Hello all,

I'm trying to create a new component for an LCD display I have. It's a KS0108 but with 192x64 dots so it haves three KS0108 chips onboard and n extra CS3 pin input.

I was trying to first make a clone of the existing KS0108 component but unfortunately the exported component doesn't have any connections.

Can you give me a brief description of how to make an exact clone of an existing component ? So I think then to modify the parameters, connections and the code to let my display works :)

I attached the resulting fcpx file.

Bernard

Re: Help to create a gLCD_KS0108 variant

Posted: Thu Sep 12, 2013 10:00 am
by JonnyW
Hi there.

You may have inherited the macros from the KS0108, but you do not inherit its properties.

Properties are like variables, and you can not use another components properties as though they are your own (there is also the issue of where to put them in your property list). I may see if something can be put in to sort that in future, but there is always with any variable the issue of who 'owns' the variable, and gets notifications when it changes.

To do this, right click the 'Properties' and select 'Copy From...' to make a list of the properties.
step_1.png
(5.5 KiB) Downloaded 10055 times
The next bit is a bit more complicated as whenever your property changes you have to copy the value down to the target. You do this whenever your property changes, in the Component.Property event:
step_2.png
(21.31 KiB) Downloaded 10055 times
You need to use the Component.Property.CopyValue() call for each property. I have recently added a call that will copy all properties in one go, but unfortunately this is the only way for now (CopyTree is available in the next patch).
step_3.png
(51.75 KiB) Downloaded 10055 times
Once you do this, any time your property changes, the base components property also changes.

I hope this works for you, keep us posted on how you go and any thoughts you have. As I say, in the next release you will be able to copy every value in one go, but unfortunately not just yet.

Jonny

Re: Help to create a gLCD_KS0108 variant

Posted: Sun Sep 15, 2013 8:45 am
by Crenwick
Hi,

Thanks for the explanation, I thougt that it was possible to create a new component (base component) and edit the code to add the extra CS3 pin and off course add some lines to integrate the extra KS0108 chip.

But it seems not possible I presume ?

Best regards,

Bernard

Re: Help to create a gLCD_KS0108 variant

Posted: Sun Sep 15, 2013 12:55 pm
by JonnyW
Hi. It will be possible - the steps in the above post will let you create an exact working copy of the KS0108 component.

What you can not do in Flowcode v6 is take someone elses component and change their flowchart. This is so that when the marketplace for components is up and running someone can not just take an existing component, copy the flowcharts and pass it off as their own product.

Unfortunately I do not know much about the gLCD mods you need to make to know what needs to be done. Do your changes need to amend the beginning, middle or end of a component routine?

Jonny

Re: Help to create a gLCD_KS0108 variant

Posted: Mon Sep 16, 2013 6:59 am
by Crenwick
Hi, well the mod is just adapt the gLCD display from 128x64 to 192x64. The design of the display is just a third KS0108 chip added on the board and one extra control line as input (CS3).
So when you have to draw something >128 you need to use the CS3 control. Maybe should be an idee to your team to adapt the component so that you can chose witch display you use (128x64 /192x64) ?

Regards,

Re: Help to create a gLCD_KS0108 variant

Posted: Mon Sep 16, 2013 10:14 am
by Benj
Hello,

I have added this in now to the base KS0108 component (probably the easiest way without going around the houses to override functions etc), would you mind testing the functionality out for me just to make sure I've got everything right.

Just pop the file into your Flowcode v6/Components directory before starting Flowcode and the changes should be loaded.

Re: Help to create a gLCD_KS0108 variant

Posted: Tue Sep 24, 2013 4:08 pm
by Crenwick
Hi Ben,

Sorry for my late reply but I was not at home ...

I just tried to compile a test program on my devboard but unfortunately I receive two syntax errors in code

/*========================================================================*\
Use :led_base1
:Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
Use :Turn the LED off.
\*=----------------------------------------------------------------------=*/
void FCD_061_led_base1__TurnOn()
{

/* Error: Syntax error */;

}

/*=----------------------------------------------------------------------=*\
Use :Turn the LED on.
\*=----------------------------------------------------------------------=*/
void FCD_061_led_base1__TurnOff()
{

/* Error: Syntax error */;

}

I attached the test program also ;-)

Kind regards,

Re: Help to create a gLCD_KS0108 variant

Posted: Tue Sep 24, 2013 4:13 pm
by Crenwick
Ooops,

Sorry Ben, problem seems to come from the Led array component :-(

Re: Help to create a gLCD_KS0108 variant

Posted: Tue Sep 24, 2013 5:17 pm
by dazz
Hi
have you tried removing the 2 semicolon from lines 421(ish) and 431(ish)

Regards
Dazz

Re: Help to create a gLCD_KS0108 variant

Posted: Tue Sep 24, 2013 5:18 pm
by Crenwick
Hi Ben,

Just tested the display on my devboard and I have a strange behaviour ..

Can you check the attached video ?

http://youtu.be/agsb3d_RvrM

Regards,

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 9:42 am
by JonnyW
Hi.
Sorry Ben, problem seems to come from the Led array component
This was to do with a bad pin assignment. This should be sorted now.

As far as the video goes, what should it be doing and what is it doing that is strange - you mean the power cycling?

Jonny

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 10:41 am
by Crenwick
Hi Jonny,

I attached the test program I used above, It's just writing "Hello" (one time !) in each corner of the display and then draw a rectangle box in the middle. In the flowcode simulation the result is ok but not on the display itself like viewed on the video. On the video you see that it write two Hello's at the same time, so at the end of the loop you see eight Hello's ... And in place of a rectangle I become a large bar in the middle of the screen.

Just let run the testprogram on flowcode and you will see the difference with the video ;-)

Regards,

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 12:08 pm
by Benj
It looks like two of the chip selects are always active, maybe I got the logic the wrong way around for these so I will investigate this now.

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 12:22 pm
by Benj
I've made some mods and hopefully this will solve the issue.
gLCD_KS0108.fcpx
(33.09 KiB) Downloaded 303 times
Let me know how you get on.

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 4:24 pm
by Crenwick
I just installed your latest version but it gives an error "Failed to add component" so I'm unable to test it.

Can you check ?

Regards,

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 4:51 pm
by Benj
Hello,

Were working on a release and I built the component using the release build DOH!! The release should happen today so you should be able to use this to check if the component is fixed.

For now I've rebuilt using an older version so let me know if you can add this.
gLCD_KS0108.fcpx
(33.09 KiB) Downloaded 276 times
Note that my older version is still going to be newer then the released version so may not work until you update to the new release.

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 5:21 pm
by Crenwick
Sorry,

Just the same error "Failed to add component"

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 5:31 pm
by JonnyW
Hi. We have modded the FCFX file format a little to support multi-dimension arrays and this means that newer components will not load correctly in the current release of Flowcode.

We are currently fixing a port access bug in the CAL, once this is 100% tested we will do a release - we are as keen to get a (working) patch out as anyone!

Jonny

Re: Help to create a gLCD_KS0108 variant

Posted: Wed Sep 25, 2013 5:47 pm
by Crenwick
No problem, I understand. Keep giving us a good support, that's great :wink:

Kind regards,

Re: Help to create a gLCD_KS0108 variant

Posted: Sat Sep 28, 2013 1:20 pm
by Crenwick
Hello all !

So I installed FC 6.0.2 and was able to compile the new fcpx component ;-)

And it works like a charm :-)

Only thing I had to do is change CS3 pin from PortC6 to PortC7 (maybe a pull up or so ?)


Regards,