CAN component settings ( CS ) and MIAC

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

CAN component settings ( CS ) and MIAC

Post 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.

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: CAN component settings ( CS ) and MIAC

Post 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

Post Reply