Page 2 of 2

Re: Seek supplementary code and lookup table advice

Posted: Mon Feb 18, 2013 8:49 am
by medelec35
oookey wrote: With your previously written program it displayed the letter "L" on the left side 5 columns, how do i modify on that program in order to display "HELLO WELCOME" :?: Please advice.
Hi ookey,
The second icon down in your flowchart you will see

Code: Select all

Text = "L"
MessageLength = Length$(Text)
Just change the L into the message:
Text = "HELLO WELCOME"
You will need leave the wording within speech marks.
If I get a chance later tonight after work, I will add the scrolling part, now that you have attached a more completed circuit diagram.
At this stage the word HELLO WELCOME will only appear in the 1st 5x7 display only. all the rest won't light.

Don't forget this is only my theory, and since I have not got the hardware, unable to test prior to posting.
So it may not work 1st time.

Martin

Re: Seek supplementary code and lookup table advice

Posted: Mon Feb 18, 2013 11:34 am
by oookey
Thanks Martin,

The characters did appear 1 by 1 in the column 1 to 5 only.

The circuit connection as attached:

Regards
oookey

Re: Seek supplementary code and lookup table advice

Posted: Wed Feb 20, 2013 9:25 am
by oookey
Hi all FC experts,

I modified the previous FC with addition of sequence count (seq_count) to monitor the pointer movement in the program, in order to turn on the respective 74HC138.
Why can't I compile the program to the device but it can successfully run simulation in the PC environment?
The failure message as: " Launching the programmer...

C:\Program Files\Matrix Multimedia\Flowcode V3\tools\PICkit2\pk2cmd_mtx.exe -PPIC16F628A -FHE7AA0~1.hex -M -A5 -H

Hex file not found.

Return code = 37

Flowcode was unable to transfer the flowchart to the microcontroller. Check the programmer options and physical connections.

FINISHED "
Any suggestion to over come please :?: my modification as attached.

Thanks
oookey

Re: Seek supplementary code and lookup table advice

Posted: Wed Feb 20, 2013 11:03 am
by medelec35
Hi oookey,
It could have something to do with the file name your using .
Try a name without spaces and and brackets (you can use undersores but i'n not sure what you can't use).
E.g
HelloWelcome2FC3modify2
or
HelloWelcome_2FC3_modify2
Etc

Martin

Re: Seek supplementary code and lookup table advice

Posted: Thu Feb 21, 2013 3:35 am
by oookey
Hi Martin, Thanks for the advice,

after changing file name, problem remain the same, the message as:
:idea:
Memory Usage Report
===================
RAM available:224 bytes, used:87 bytes (38.9%), free:137 bytes (61.1%),
Heap size:137 bytes, Heap max single alloc:79 bytes
ROM available:2048 words, used:1097 words (53.6%), free:951 words (46.4%)
success
Return code = 0
Launching the programmer...
C:\Program Files\Matrix Multimedia\Flowcode V3\tools\PICkit2\pk2cmd_mtx.exe -PPIC16F628A -FHE4879~1.hex -M -A5 -H
Hex file not found.
Return code = 37
Flowcode was unable to transfer the flowchart to the microcontroller. Check the programmer options and physical connections.
FINISHED :idea:

I went on downloaded the free version of FC5, simulation could perform on the PORT A, but not PORT B as it was programmed to use C code. The message as:

:idea: Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support. :idea:

The only C code in this program is: "FCV_ROW =StoredText[FCV_INDEX+FCV_COLUMN-8];" does this something to do with the "seq_count" variable that i added in :?: Please advice.

oookey

Re: Seek supplementary code and lookup table advice

Posted: Thu Feb 21, 2013 1:23 pm
by Benj
Hello,

I think v3 may have had file path problems. Try renaming your Flowcode file to be 8 characters or less and try that.

If that is not working then create a folder directly off the the root of C named FC so you get a directory with the path C:\FC\. Save your renamed Flowcode file here and see if that works.

If that is not working then you could try adding speech marks around your filename.

C:\Program Files\Matrix Multimedia\Flowcode V3\tools\PICkit2\pk2cmd_mtx.exe -PPIC16F628A -F"HE4879~1.hex" -M -A5 -H

Re: Seek supplementary code and lookup table advice

Posted: Thu Feb 21, 2013 2:34 pm
by medelec35
Hi ookey,
Have you read this:
http://www.matrixmultimedia.com/support ... ckit#p1181
As it looks like your file name is incorrectly picked up.

It's Flowcode 4 support but may work with Flowcode3?

Or for V5 support see:
http://www.matrixmultimedia.com/support ... 433&#p1433

I compiled V5 version and got no compile errors.

Martin

Re: Seek supplementary code and lookup table advice

Posted: Sun Feb 24, 2013 1:23 pm
by oookey
Hi All,

I encountered compiling errors:

error: too many initializers
error: unexpected [] operation on identifier 'mess'
error: failed to generate expression
error: invalid operand 'mess[index]'
error: failed to generate expression

I have the following values in the Supplementary Code:
int mess = {
127, 8, 8, 8, 127, // H
127, 73, 73, 73, 65, // E
127, 64, 64, 64, 64, // L
127, 64, 64, 64, 64, // L
62, 65, 65, 65, 62, // O
0, 0, 0, 0, 0, // BLANK
127, 16, 8, 16, 127, // W
127, 73, 73, 73, 65, // E
127, 64, 64, 64, 64, // L
62, 65, 65, 65, 34, // C
62, 65, 65, 65, 62, // O
127, 2, 4, 2, 127, // M
127, 73, 73, 73, 65, // E
0, 0, 0, 0, 0, // BLANK };

And two C codes, one each in the main program and ISR:
1. { int mess[70], index ; }
2. FCV_ROW = mess[index];

Please advice how should straighten all these error. :?:

Thanks
oookey

Re: Seek supplementary code and lookup table advice

Posted: Sun Feb 24, 2013 1:39 pm
by kersing
oookey wrote: error: too many initializers
error: unexpected [] operation on identifier 'mess'
error: failed to generate expression
error: invalid operand 'mess[index]'
error: failed to generate expression
For the future, it would be easier for people trying to help if you attached the generated C code ( .c file ) and included the line numbers in the error messages.
oookey wrote:I have the following values in the Supplementary Code:
int mess = {
This needs to be 'int mess[] = {' because it is an array. You are now trying to put multiple elements into a single container (integer). There is no need to specify the number of elements between the brackets, the compiler will know the correct length.
oookey wrote:And two C codes, one each in the main program and ISR:
1. { int mess[70], index ; }
This redeclares the array. As you defined it in the supplementary code there is no need to declare it again. Just use mess[].

Re: Seek supplementary code and lookup table advice

Posted: Sun Feb 24, 2013 1:42 pm
by medelec35
Hi oookey
on the last line you have got

0, 0, 0, 0, 0, // BLANK };

Can you try

0, 0, 0, 0, 0}; // BLANK

Since the braces and semicolon are after the // comments
Therefore as far as the compiler is concerned you have not added them.

For BoostC compiler the format its

Code: Select all

rom char* Variable ={
data1,data2, etc
For Hitec its

Code: Select all

const char Variable[Number of data items]=			
{			
 Data1,Data2, etc.
there is no comma required after the last data item.

You did have a flowchart which correctly placed the char on LED's.
You can look at the supplementary code on that flowchart to see how the format should look like.

Martin

Re: Seek supplementary code and lookup table advice

Posted: Mon Feb 25, 2013 2:57 am
by oookey
Hi All,

I still encountered fail compiling, following are the error messages:

C:\Indexing.c(82:17): error: unknown identifier 'index'
C:\Indexing.c(82:17): error: invalid index
C:\Indexing.c(82:12): error: failed to generate expression
C:\Indexing.c(82:12): error: invalid operand 'mess[index]'
C:\Indexing.c(82:10): error: failed to generate expression
C:\Indexing.c(135:4): error: array with undefined or zero dimension
Indexing.c success
failure
..
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.

FINISHED

The FC is attached, please any advice :?:

Thanks
oookey

Re: Seek supplementary code and lookup table advice

Posted: Mon Feb 25, 2013 10:36 am
by medelec35
Hi oookey ,
If you look at the flowchart I posted for you in an earlier post, you will see the format used in retrieving lookup tables.
I used:
FCV_ROW =StoredText[FCV_INDEX+FCV_COLUMN-8];
Notice two things.

1 FCV_ is preceding variables.
When you wish to retrieved a FlowCodeVariable with C, the you must precede variable with FCV_

2)All retrieved variables not only should precede with FCV_ but should also be in UPPERCASE.
E.g. Your variable is called CountVariable then when retrieving in c you must use FCV_COUNTVARIABLE
Change FCV_ROW = mess[index];
to
To FCV_ROW = mess[FCV_INDEX];

Your declaring { int mess[];
}
Twice,
Once in main and then within supplementary code window.
For look up tables it should only be declared within supplementary code window, and varibles only have to be declared once.
That's what the suplementary code window is allowing to do.
You will need to delete the entry int mess[] = { }from main.
Format of int mess[] = {
Is wrong.
First your declaring as int so instead of 70 lots of bytes = 70*8 bits (560 memory locations in ROM)
Your declaring 70 lots of integers = 70*16 bits (1120 memory locations in ROM)
Secondly you can either use a number like Jac stated and declare as char
char mess[70] = {
Or no need for number (guess that's easiest as Jac showed:
char mess[] = {
or use:
rom char* mess ={


If your still stuck I will post a corrected flowchart.

Martin

Re: Seek supplementary code and lookup table advice

Posted: Tue Mar 19, 2013 7:20 am
by oookey
Hi Martin :D

i failed to modify your version of FC to perform scrolling display of the "HELLO WELCOME", instead i worked out my own, it could display scrolling started from right to left, but my FC got a limitation, could not display long messages, i tried display all the 26 alphabets, encountered not enough RAM :x

Attached is my version of FC that worked with short message display, please advice the correct method.

Thanks