PIC 32MX150 and 24FJ64GB002 SPI Slave Error

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

Moderator: Benj

Post Reply
Pascal_2016
Posts: 89
Joined: Wed Aug 31, 2016 4:48 pm
Been thanked: 4 times
Contact:

PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Post by Pascal_2016 »

Hello
I try to run the 32MX150 and the 24FJ64GB002 as "SPI Slave".

Unfortunately I get the following error message during build.

C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat "SPI_Slave_Error" "D:\PR6751~1\" "24FJ64GB002"

D:\PR6751~1>xc16-gcc -c -mcpu="24FJ64GB002" -omf=coff -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\" -std=gnu99 "SPI_Slave_Error".c -o "SPI_Slave_Error".o
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:1062:0,
from SPI_Slave_Error.c:570:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_SPI.c: In function 'FC_CAL_SPI_Slave_Init_1':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_SPI.c:698:2: error: 'tris' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_SPI.c:698:2: note: each undeclared identifier is reported only once for each function it appears in
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_SPI.c: In function 'FC_CAL_SPI_Slave_Uninit_1':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_SPI.c:871:2: error: 'tris' undeclared (first use in this function)
SPI_Slave_Error.c: In function 'FCD_01531_cal_spi__Prv_SimShowWaveform':
SPI_Slave_Error.c:681:31: error: macro "SET_PORT_MASK" requires 3 arguments, but only 2 given
SPI_Slave_Error.c:681:6: error: 'SET_PORT_MASK' undeclared (first use in this function)
SPI_Slave_Error.c:736:31: error: macro "SET_PORT_MASK" requires 3 arguments, but only 2 given

Error returned from [xc16-gcc.exe]

C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat Hat den Fehlercode 1 gemeldet



Can someone tell me what I did wrong
Attachments
SPI_Slave_Error.c
(49.34 KiB) Downloaded 136 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: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Post by Benj »

Hello,

Please can you post your .fcfx Flowcode project file.

From the C file it looks like maybe the pin connection for the SCK pin is not assigned.

Pascal_2016
Posts: 89
Joined: Wed Aug 31, 2016 4:48 pm
Been thanked: 4 times
Contact:

Re: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Post by Pascal_2016 »

Hello,

the right file
Attachments
SPI_Slave_Error.fcfx
(10.78 KiB) Downloaded 141 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: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Post by Benj »

Hello,

In the properties for the SPI_Slave1 component the CLK remap pin property is blank. Assign a pin and hopefully it will start compiling correctly for you.
SPISlave.jpg
SPISlave.jpg (61.61 KiB) Viewed 2105 times
Your program will likely also need modification as it's not using the SPI slave interrupt etc to get the data from the master. See here for an example.

https://www.matrixtsl.com/wiki/index.ph ... Interface)

Pascal_2016
Posts: 89
Joined: Wed Aug 31, 2016 4:48 pm
Been thanked: 4 times
Contact:

Re: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Post by Pascal_2016 »

Hi, Benj,

thank you for your extensive help

Post Reply