LCD displays only work with modified RAWSEND

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

Moderator: Benj

Post Reply
chico
Posts: 34
Joined: Fri Dec 26, 2008 11:30 pm
Has thanked: 12 times
Been thanked: 10 times
Contact:

LCD displays only work with modified RAWSEND

Post by chico »

Hi - I purchased FC6 a while back...just starting to take a serious look at it.

I have a large number of 4x20 and 2x16 LCD displays on hand. The code generated by Flowcode for PIC18F parts doesn't work reliably with all of them. Some work just fine, but others generate gibberish characters. I'm a hardware guy and everything checks out ok...i figured it to be a timing issue. The crystal and config bits and Flowcode processor speed settings all look ok.

Turns out if I change the delays in the Flowcode C source code "RAWSEND" routine from 100us to 166us all my displays work fine. I haven't pulled out a scope to figure out exactly where the issue is, but changing the source in the Flowcode LCD display components folder fixes everything.

My question: is there a way to create a component with the modified source code inside (something like "4x20 Slow LCD Display") that I can call up and use, rather than having to keep my modified Flowcode code intact whenever I reinstall Flowcode? Or is there an alternative way to set this up, like adding a DELAY parameter to an LCD component that can be set from within Flowcode?

...just wondering what the best approach might be...

chico
Posts: 34
Joined: Fri Dec 26, 2008 11:30 pm
Has thanked: 12 times
Been thanked: 10 times
Contact:

Re: LCD displays only work with modified RAWSEND

Post by chico »

I see that in Flowcode v5 there was a way to directly modify component source code by clicking on the component and selecting "Custom Code": https://www.youtube.com/watch?v=hb41C5gb_ww

I can't see that feature in Flowcode v6 or v7...is there a way to do that?

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: LCD displays only work with modified RAWSEND

Post by Benj »

Hello,

V6 and V7 do not support component customisation. Instead there is component creation allowing you to create any component you wish.

What custom code did you use in v5? Maybe we can make you a slightly tweaked LCD component or maybe we can put in the changes and allow them to be switched on or off via a property.

chico
Posts: 34
Joined: Fri Dec 26, 2008 11:30 pm
Has thanked: 12 times
Been thanked: 10 times
Contact:

Re: LCD displays only work with modified RAWSEND

Post by chico »

Hello Benj - Thanks for the response.
Benj wrote: V6 and V7 do not support component customisation. Instead there is component creation allowing you to create any component you wish.
Sounds great...but I haven't been able to find any step-by-step instructions for that. Can you point me to some?
Benj wrote:What custom code did you use in v5? Maybe we can make you a slightly tweaked LCD component or maybe we can put in the changes and allow them to be switched on or off via a property.
I've been away from Flowcode for a few years. Just recently purchased v6 and then v7 when it was announced shortly thereafter. As I recall, I used to tweak components quite often to match particular hardware requirements.

At the moment I'm looking for a way to change the 100us delays of the 4x20 LCD Display from 100us to 166us to match some sluggish units I have. As I recall, that was easy to do in v5. How might I do that in v6/v7?

Thanks...

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: LCD displays only work with modified RAWSEND

Post by Benj »

Hello,

I have edited the "LCD generic" component so that you can now edit the delay via one of the component properties. The default is 100us but simply changing this value to 166 should give you the longer delay you need.
LCD.jpg
LCD.jpg (40.76 KiB) Viewed 7505 times
Simply copy the file into the "Flowcode x/Components" directory.

Flowcode v6 component
LCD.fcpx
(6.71 KiB) Downloaded 358 times
Flowcode v7 component
LCD.fcpx
(6.39 KiB) Downloaded 308 times

chico
Posts: 34
Joined: Fri Dec 26, 2008 11:30 pm
Has thanked: 12 times
Been thanked: 10 times
Contact:

Re: LCD displays only work with modified RAWSEND

Post by chico »

Benj wrote:Hello,

I have edited the "LCD generic" component so that you can now edit the delay via one of the component properties.
Benj, thank you. Above and beyond what I could have asked. Works great...now my surplus LCDs (beautiful displays, but not standard spec) all work fine.
Benj wrote:V6 and V7 do not support component customisation. Instead there is component creation allowing you to create any component you wish.
So with V7 I should be able to modify a component's C code and insert it into a newly created component...great! But I haven't found a way to do that in the Flowcode help...is it there? Or can you point me to instructions or a tutorial? Or explain how you created this particular LCD component?

Thanks much...

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: LCD displays only work with modified RAWSEND

Post by Benj »

Hello Chico,

Thanks for letting me know the addition of the new property is working for you.

Component customisation in v5 was a nice feature but I found it often confused users and tended to break their programs more than it allowed them to add extra features. A user would release an example with customised code, someone else would try to use the example, maybe with a different chip and immediately run into problems which we then had to try and support. In v6 and v7 the components are locked down but the component creator interface allows you to easily create your own components from scratch or to take an existing component and add more code or functionality to it. The case you have where there is a section of code that needed a slight tweak is now much better dealt with using the flexible v6 and v7 component properties rather than forcing a user to delve straight into C code. Most Flowcode users use Flowcode because they don't want to have to deal directly with C.

We have a section in our help Wiki regarding component creating which should help you to get started.

http://www.matrixtsl.com/wikiv7/index.p ... p_Overview

Scroll down to the Component creation section and there are several topics there to help.

There are also component creation worked exercises available from here.

http://www.matrixtsl.com/wikiv7/index.p ... =Exercises

chico
Posts: 34
Joined: Fri Dec 26, 2008 11:30 pm
Has thanked: 12 times
Been thanked: 10 times
Contact:

Re: LCD displays only work with modified RAWSEND

Post by chico »

Thanks for the pointers, Benj. I have now worked through the tutorials and created components as described.

But despite the excellent step-by-step instructions, I feel that it would be helpful to have some kind of architectural overview of Flowcode components and events. A higher-level description of Flowcode's internal workings would give meaning to the individual steps, which leave me wondering what each step is for and why.

However...this particular thread is probably not an appropriate place to pursue this topic. I'll start a new thread in the V7 sub-forum for further component creation discussion.

But I'd like to respond to your comment:
Benj wrote:Most Flowcode users use Flowcode because they don't want to have to deal directly with C.
Of course you know your users and the target market for your product. But as someone who does know C and compilers and the underlying hardware, I find Flowcode to be very useful to quickly generate C code without compiler errors, simplify the process of setting up particular processors and hardware components, simplify migration from one processor to another, generate C code with extensive comments, and leave a set of accurate Flowcharts to document the project...something that rarely exists beyond the initial design phase of a non-Flowcode project.

I use both Flowcode and the generated C code for debugging. I use software and hardware tools to step through and breakpoint the C code but use Flowcode to make the necessary code changes. (For this the move to the XC compilers is very much appreciated!) I find Flowcode to be of great assistance in making a project come together faster, with less attention needing to be paid to the lower-level details of the more typical type-and-compile development process.

These are the reasons why I find it important to be able to create, examine, modify and tweak components. The ability to tweak a component's underlying C code was available in V5, but not the ability to modify the simulation process. It appears that V6 and V7 allow both code and simulation to be modified, but there's a higher learning curve required to get there. That's ok...as long as the information and documentation is available, I'm willing to try to figure it out.

Anyway, my point is, I'm sure there are many Flowcode users (or potential Flowcode users) out there who see Flowcode as more than an educational tool, or something to be used only by those who don't want to have to deal directly with C....

Post Reply