I2C doesn't compile with 24FJ256GA110 and DA110

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

I2C doesn't compile with 24FJ256GA110 and DA110

Post by Mathy »

Hello,

An other bug with this chip family :

Flowcode1.c: In function 'FCD_I2C_Master0_MI2C_Init':
Flowcode1.c:1214: error: 'I2CCONbits' undeclared (first use in this function)
Flowcode1.c:1214: error: (Each undeclared identifier is reported only once
Flowcode1.c:1214: error: for each function it appears in.)
Flowcode1.c:1224: error: 'I2CBRG' undeclared (first use in this function)
Flowcode1.c: In function 'FCD_I2C_Master0_MI2C_Start':
Flowcode1.c:1310: error: 'I2CCONbits' undeclared (first use in this function)
Flowcode1.c: In function 'FCD_I2C_Master0_MI2C_Restart':
Flowcode1.c:1348: error: 'I2CCONbits' undeclared (first use in this function)
Flowcode1.c: In function 'FCD_I2C_Master0_MI2C_Stop':
Flowcode1.c:1392: error: 'I2CCONbits' undeclared (first use in this function)
Flowcode1.c: In function 'FCD_I2C_Master0_MI2C_Transmit_Byte':
Flowcode1.c:1437: error: 'I2CTRN' undeclared (first use in this function)
Flowcode1.c:1438: error: 'I2CSTATbits' undeclared (first use in this function)
Flowcode1.c: In function 'FCD_I2C_Master0_MI2C_Receive_Byte':
Flowcode1.c:1511: error: 'I2CCONbits' undeclared (first use in this function)
Flowcode1.c:1518: error: 'I2CRCV' undeclared (first use in this function)

Error returned from [pic30-gcc.exe]

Can you solve this quickly? Impossible to make something with this Flowcode release...

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: I2C doesn't compile with 24FJ256GA110 and DA110

Post by Benj »

Hello,

I'm guessing here but this could help. Go into the project options, enable supplementary code and then click edit supplementary code.

Where you have undeclared errors try defining them as this.

#define I2CCONbits I2C1CONbits

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

Re: I2C doesn't compile with 24FJ256GA110 and DA110

Post by Steve »

Sorry that we've not address your problem(s) before - things are pretty busy here as we gear up to the release of Flowcode V5.

Ben and I have looked at this and a temporary solution is to right-click the I2C component and select "Custom Code". In the window, select {Defines] and edit the code. At the bottom, comment-out the following lines:

Code: Select all

/*
#ifndef I2C1CON
	#define I2C1RCV			I2CRCV
	#define I2C1TRN			I2CTRN
	#define I2C1BRG			I2CBRG
	#define I2C1CON			I2CCON
	#define I2C1STAT		I2CSTAT
	#define I2C1ADD			I2CADD
	#define I2C1RCVbits		I2CRCVbits
	#define I2C1TRNbits		I2CTRNbits
	#define I2C1BRGbits		I2CBRGbits
	#define I2C1CONbits		I2CCONbits
	#define I2C1STATbits	I2CSTATbits
	#define I2C1ADDbits		I2CADDbits
#endif
*/
This allows the file to compile. A similar technique may help solve some of your other issues.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: I2C doesn't compile with 24FJ256GA110 and DA110

Post by Mathy »

Hello,
Sorry I annoying but I tear my hair for several days!

Your tips works, I tried a similar thing by directly changing your I2C component C file.

Now it compiles and I can watch the SDA and SCL line on my screen but if I connect this line to my other card, the µC stop running.
Maybe a hard probleme but if I try with the same pin with the I2C software, no problem. Do you have any idea ?

Thank you both ;-)

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: I2C doesn't compile with 24FJ256GA110 and DA110

Post by Mathy »

Reducing my pull up resistors from 4.7K to 2.7K solve the problem !

Thank you again.

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: I2C doesn't compile with 24FJ256GA110 and DA110

Post by Benj »

Thanks for letting us know Mathy, Glad its working ok for you now.

Post Reply