Error during compilation with SPI protocole on PIC 18F6***

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

Post Reply
WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm
Contact:

Error during compilation with SPI protocole on PIC 18F6***

Post by WalkOver »

Hello the Flowcode community !

I have lots of errors when I compiling program with SPI protocol on PIC 18F6*** and PIC 18F8*** ( I use PIC 18F6527 an 6622 ). When i compil the same program on pic 18F2*** or 18F4***, it works very well. I made a simple test program who just send an octet in SPI and i have the same problem with the last flowcode revision :

\SPI test\Flowcode1.c(172:2): error: unknown identifier 'sspstat'
\SPI test\Flowcode1.c(172:2): error: invalid operand 'sspstat'
\SPI test\Flowcode1.c(172:10): error: failed to generate expression
\SPI test\Flowcode1.c(179:2): error: unknown identifier 'sspcon1'
\SPI test\Flowcode1.c(179:2): error: invalid operand 'sspcon1'
\SPI test\Flowcode1.c(179:10): error: failed to generate expression
\SPI test\Flowcode1.c(180:4): error: unknown identifier 'sspcon1'
\SPI test\Flowcode1.c(180:4): error: invalid operand 'sspcon1'
\SPI test\Flowcode1.c(180:13): error: failed to generate expression
\SPI test\Flowcode1.c(196:4): error: unknown identifier 'sspcon1'
\SPI test\Flowcode1.c(196:4): error: invalid operand 'sspcon1'
\SPI test\Flowcode1.c(196:13): error: failed to generate expression
\SPI test\Flowcode1.c(209:2): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(209:2): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(209:9): error: failed to generate expression
\SPI test\Flowcode1.c(212:10): error: unknown identifier 'sspstat'
\SPI test\Flowcode1.c(212:10): error: invalid operand 'sspstat'
\SPI test\Flowcode1.c(212:18): error: failed to generate expression
\SPI test\Flowcode1.c(212:18): error: invalid operand '& '
\SPI test\Flowcode1.c(212:26): error: failed to generate expression
\SPI test\Flowcode1.c(212:26): internal error: failed to generate 'while' expression
\SPI test\Flowcode1.c(212:2): error: error in 'while' loop statement
\SPI test\Flowcode1.c(224:2): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(224:2): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(224:9): error: failed to generate expression
\SPI test\Flowcode1.c(227:10): error: unknown identifier 'sspstat'
\SPI test\Flowcode1.c(227:10): error: invalid operand 'sspstat'
\SPI test\Flowcode1.c(227:18): error: failed to generate expression
\SPI test\Flowcode1.c(227:18): error: invalid operand '& '
\SPI test\Flowcode1.c(227:26): error: failed to generate expression
\SPI test\Flowcode1.c(227:26): internal error: failed to generate 'while' expression
\SPI test\Flowcode1.c(227:2): error: error in 'while' loop statement
\SPI test\Flowcode1.c(230:11): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(230:11): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(230:9): error: failed to generate expression
\SPI test\Flowcode1.c(256:2): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(256:2): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(256:9): error: failed to generate expression
\SPI test\Flowcode1.c(260:2): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(260:2): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(260:9): error: failed to generate expression
\SPI test\Flowcode1.c(339:2): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(339:2): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(339:9): error: failed to generate expression
\SPI test\Flowcode1.c(342:10): error: unknown identifier 'sspstat'
\SPI test\Flowcode1.c(342:10): error: invalid operand 'sspstat'
\SPI test\Flowcode1.c(342:18): error: failed to generate expression
\SPI test\Flowcode1.c(342:18): error: invalid operand '& '
\SPI test\Flowcode1.c(342:26): error: failed to generate expression
\SPI test\Flowcode1.c(342:26): internal error: failed to generate 'while' expression
\SPI test\Flowcode1.c(342:2): error: error in 'while' loop statement
\SPI test\Flowcode1.c(344:11): error: unknown identifier 'sspbuf'
\SPI test\Flowcode1.c(344:11): error: invalid operand 'sspbuf'
\SPI test\Flowcode1.c(344:9): error: failed to generate expression
Flowcode1.c success

failure

Return code = 1

Please can you tell me what I can do to fix this problem ?

Thank you very much for your help !

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: Error during compilation with SPI protocole on PIC 18F6***

Post by Benj »

Hello

The problem arises because these chips have 2 synchronous serial ports and therefore the registers are named slightly different to the other devices.

Please can you check which version of Flowcode 3 you are using. It is probable that this problem has been fixed in the latest releases of Flowcode (3.4.7).

If you want a quick fix then you can goto Edit -> Supplementary code and then copy the following lines of text into the defines section.

Code: Select all

#define sspbuf ssp1buf
#define sspcon1 ssp1con1
#define sspstat ssp1stat
Your program should now compile correctly.

WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm
Contact:

Re: Error during compilation with SPI protocole on PIC 18F6***

Post by WalkOver »

Thank you for your Help.

I have the last Flowcode version ( 3.4.7.48 )

Nevertheless, I try to put your code into a define section and i still have this problem :cry:

If you use a SPI communication on a 18F6622, can you compile correctly ?

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Error during compilation with SPI protocole on PIC 18F6***

Post by Steve »

I've just tried this and it looks like the latest FCD file is incorrect - I'll ask Ben to fix this.

But I also tried Ben's workaround and this worked fine - the code compiled without error.

WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm
Contact:

Re: Error during compilation with SPI protocole on PIC 18F6***

Post by WalkOver »

Can you send me your file please ? I could see the tips.
I really can't compile with this method. I should probably do something wrong.

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Error during compilation with SPI protocole on PIC 18F6***

Post by Steve »

It is attached. If it contains some wierd text, don't worry - I'm currently creating a Turkish version of Flowcode.
Attachments
spi - 6622.fcf
(4.5 KiB) Downloaded 321 times

WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm
Contact:

Re: Error during compilation with SPI protocole on PIC 18F6***

Post by WalkOver »

Thank you very much,

I realized my mistake. I used the AddDefines icon instead of the edit menu.

It compiles very well now !

Thank you Benj and steve.

Post Reply