Page 1 of 1

PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Posted: Sun Mar 22, 2020 10:29 pm
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

Re: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Posted: Mon Mar 23, 2020 10:40 am
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.

Re: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Posted: Mon Mar 23, 2020 10:23 pm
by Pascal_2016
Hello,

the right file

Re: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Posted: Thu Mar 26, 2020 12:03 am
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 2840 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.flowcode.co.uk/wiki/index.ph ... Interface)

Re: PIC 32MX150 and 24FJ64GB002 SPI Slave Error

Posted: Fri Mar 27, 2020 9:09 am
by Pascal_2016
Hi, Benj,

thank you for your extensive help