Page 1 of 1

CAN component settings ( CS ) and MIAC

Posted: Sat Feb 25, 2012 4:41 pm
by Jay Dee
Hi ya,
I must have missed something very obvious but...
I need to set the CS pin for the CAN component to work in the MIAC, the MIAC guide p.11 (MI3278) has CS on pin RD7.
But the port options in the components connections menu does not list port D.
What am I missing here? :?
I'm using FCV5.
Cheers all, J.

Re: CAN component settings ( CS ) and MIAC

Posted: Mon Feb 27, 2012 12:44 pm
by Benj
Hello,

If your target device is set to MIAC in the Flowcode project options window then Flowcode automatically overrides the CS connection from the connections window to pin D7.

Code: Select all

	//Definitions for CS control lines
	#define CAN_2_MX_CAN_CS_PIN		6
	#define CAN_2_MX_CAN_CS_PORT		portb
	#define CAN_2_MX_CAN_CS_TRIS		trisb

	//hardcode if using the MIAC
	#ifdef MX_MIAC
	  #undef CAN_2_MX_CAN_CS_PIN
	  #undef CAN_2_MX_CAN_CS_PORT
	  #undef CAN_2_MX_CAN_CS_TRIS
	  #define CAN_2_MX_CAN_CS_PIN		7
	  #define CAN_2_MX_CAN_CS_PORT		portd
	  #define CAN_2_MX_CAN_CS_TRIS		trisd
	#endif