LCD EB005 without macros

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

Moderator: Benj

Post Reply
User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

LCD EB005 without macros

Post by Jan Lichtenbelt »

I imported an Flowcode 6 program with LCD (EB005) into the Flowcode 7. This LCD is part of the free components in Flowcode 7. In the project explorer the LCD has been liated in the components, but without any macro like start , clear etc. Coversion to the hex file gives the error of missing LCD macros.

What to do?

Kind regrads

Jan Lichtenbelt

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 EB005 without macros

Post by Benj »

Hi Jan,

Try using the updated files posted here and hopefully that should solve the issue for you.

http://www.matrixtsl.com/mmforums/viewt ... 63&t=17953

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: LCD EB005 without macros

Post by Jan Lichtenbelt »

The next error are undefined C-variables, like osccon, etc, see attachment for details.
Accu_Activator_V42_F7.msg.txt
(3.43 KiB) Downloaded 275 times
What to do?

With kind regards

Jan Lichtenbelt

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: LCD EB005 without macros

Post by QMESAR »

HI
As far as I know the syntax for the boostC compiler is small letter for register names and the XC8 use capital letter
so any Code you have in a C Component you will have to adapt to the new syntax

old code = osccon new XC8 Syntax is OSCCON and bits value are as such
TRISBbits.TRISB0

Hope this helps you :D

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: LCD EB005 without macros

Post by Jan Lichtenbelt »

One problem left. Test bit does not work.
Old:
While(ts_bit(adcon0,1));
New:
While(ts_bit(ADCON0,1));
Error message Flowcode 7:
while((ADCON0bits.1));
^ (195) expression syntax
(194) ")" expected ^
What to do?

With kind regards

Jan Lichtenbelt

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: LCD EB005 without macros

Post by QMESAR »

I do not know this FC testbit function however I would expect that
you have to use the name of bit 1 as per datasheet

ADCON0bits.NAME

what controller are you using and I can help to look for the correct name :D

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: LCD EB005 without macros

Post by Jan Lichtenbelt »

Dear QMESAR,

I use the xc8 compiler. Tell me where I find information about this compiler?

Thanks a lot

Jan Lichtenbelt

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: LCD EB005 without macros

Post by QMESAR »

Hi Jan

You can get a manual for the compiler at the Microchip web page ,
If you are using a PIC18 then the ADCON0 bit one is the GO/DONE bit
In the XC compiler you would use ADCON0bits.DONE however I saw a post from Martin which mentioned something about to add the over score you need to include $ sign but not sure where and how
I am also still learning FC interaction with XC8 however I am well aware of how the XC8 compiler functions in a Normal Editor
so I do not want to mislead you in this case with the DONE bit which has an over score on a second thought you probably could use ADCON0bits.GO

Ben or Martin will help us out here :D
Attachments
22.08.jpg
22.08.jpg (47.03 KiB) Viewed 6058 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: LCD EB005 without macros

Post by LeighM »

You can find the names that the compiler accepts if you search in the device header file for the register name,
e.g. search for ADCON0 in ..Flowcode7\compilers\pic\include\pic16f1937.h

There you will see that this register bit is named GO_nDONE, or GO, or nDONE
So you could use:

Code: Select all

while(ts_bit(ADCON0, GO));
Alternatively, if you know the bit number, and not the name, you could use the test_bit macro instead:

Code: Select all

while(test_bit(ADCON0, 1));
Hope that helps,
Leigh

ps. Just came across this generic solution too, from medelec35 http://www.matrixtsl.com/mmforums/viewt ... 26&t=17804

Post Reply