Page 1 of 1

Does not compile with I2C component

Posted: Sun Mar 05, 2017 6:05 pm
by howard123
Hello Everyone

I am using a PIC24FV16KA304 and, after adding a few I2C things, am getting the following error when compiling;

In file included from C:\Program Files (x86)\Flowcode 7\CAL\includes.c:246:0,
from Main 03.c:412:
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c: In function 'FC_CAL_I2C_Slave_RxByte_1':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:602:20: error: 'I2C1STATBITS' has no member named 'D_A'
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:602:41: error: 'I2C1STATBITS' has no member named 'R_W'
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c: In function 'FC_CAL_I2C_Slave_Status_1':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:689:19: error: 'I2C1STATBITS' has no member named 'R_W'
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:692:19: error: 'I2C1STATBITS' has no member named 'D_A'

Error returned from [xc16-gcc.exe]
Completed compilation, return = 1


Is there a CAL file that I need to install?

Thanks Howard

Re: Does not compile with I2C component

Posted: Mon Mar 06, 2017 11:26 am
by Benj
Hi Howard,

Many thanks for letting us know. This problem has now been found and resolved.

Simply copy the attached file into your "Flowcode 7/CAL/PIC16BIT" folder and then compilation should work correctly.
PIC16BIT_CAL_I2C.c
(25.28 KiB) Downloaded 279 times
Let us know how you get on.

Re: Does not compile with I2C component

Posted: Mon Mar 06, 2017 1:33 pm
by howard123
Thanks Ben that has worked.
Just with a heads up in mind of your pending release - I now get IRQ warnings which I can not remember getting before. Seems unrelated to me but may be useful for you to know;

Main 03.c: In function '_T1Interrupt':
elf-cc1.exe: warning: _T1Interrupt PSV model not specified for '_T1Interrupt';
assuming 'auto_psv' this may affect latency
Main 03.c: In function '_U2RXInterrupt':
elf-cc1.exe: warning: _U2RXInterrupt PSV model not specified for '_U2RXInterrupt';
assuming 'auto_psv' this may affect latency

cheers
Howard

Re: Does not compile with I2C component

Posted: Mon Mar 06, 2017 1:50 pm
by Benj
Hi Howard,

Those warnings are normal, just saying it's using the auto interrupt table, if you need guaranteed latency in your application then you have to create your own specific interrupt vector table.