Seek supplementary code and lookup table advice

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seek supplementary code and lookup table advice

Post 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
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seek supplementary code and lookup table advice

Post 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
Attachments
veroconnection.png
(50.63 KiB) Downloaded 3657 times
HELLOWELCOME.png
(203.25 KiB) Downloaded 3657 times

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seek supplementary code and lookup table advice

Post 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
Attachments
HelloWelcome 2 FC3 (modify2).fcf
(11.5 KiB) Downloaded 286 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seek supplementary code and lookup table advice

Post 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
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seek supplementary code and lookup table advice

Post 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
Attachments
HelloWelcome 2FC5modify2.fcf
FC5 Free version
(17.87 KiB) Downloaded 267 times
HelloWelcome2FC3Modify.fcf
FC3 version
(11.5 KiB) Downloaded 270 times

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: Seek supplementary code and lookup table advice

Post 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

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seek supplementary code and lookup table advice

Post 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
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seek supplementary code and lookup table advice

Post 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

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: Seek supplementary code and lookup table advice

Post 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[].
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seek supplementary code and lookup table advice

Post 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
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seek supplementary code and lookup table advice

Post 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
Attachments
Indexing.fcf
(7 KiB) Downloaded 243 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seek supplementary code and lookup table advice

Post 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
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seek supplementary code and lookup table advice

Post 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
Attachments
Hello1.png
(228.32 KiB) Downloaded 3488 times
Hello01.fcf
(10 KiB) Downloaded 197 times

Post Reply