Recherche de code C pour le bus CAN pour PIC18F458

S

shoqeen

Guest
Quelqu'un at-il «code C pour l'initialisation du contrôleur de bus CAN dans le microcontrôleur PIC18F458.<img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Question" border="0" />
 
i cant ne

<img src="http://www.edaboard.com/images/smiles/icon_cry.gif" alt="Pleure ou très triste" border="0" />

il ne marche pas de travail

<img src="http://www.edaboard.com/images/smiles/icon_cry.gif" alt="Pleure ou très triste" border="0" />
 
utiliser un logiciel de mikroC Mikroelectronica.sa version démo est gratuite.
il hs mais j'ai toutes les fonctions du CAN intégré.tous les u as à faire est d'appeler ces fonctions/ / CAN calendrier
SJW = 1;
BRP = 1;
Phase_Seg1 = 6;
Phase_Seg2 = 7;
Prop_Seg = 6;

/ / Flags
init_flag = & CAN_CONFIG_SAMPLE_THRICE
CAN_CONFIG_PHSEG2_PRG_ON &
CAN_CONFIG_STD_MSG &
CAN_CONFIG_DBL_BUFFER_ON &
CAN_CONFIG_VALID_STD_MSG &
CAN_CONFIG_LINE_FILTER_OFF;
send_flag = & CAN_TX_PRIORITY_0
CAN_TX_STD_FRAME &
CAN_TX_NO_RTR_FRAME;
read_flag = 0;

/ / Initialiser CAN
CANInitialize (millepertuis, BRP, Phase_Seg1, Phase_Seg2, Prop_Seg, init_flag);

CANSetOperationMode (CAN_MODE_CONFIG, 0xFF);
masque =- 1;

CANSetMask (CAN_MASK_B1, masque, CAN_CONFIG_STD_MSG);
CANSetMask (CAN_MASK_B2, masque, CAN_CONFIG_STD_MSG);

CANSetFilter (CAN_FILTER_B2_F3, 44, CAN_CONFIG_STD_MSG); / id panique / == 44
CANSetOperationMode (CAN_MODE_NORMAL, 0xFF);fichiers d'aide sont faciles à utiliser trop amical.u pouvez personnaliser toutes les valeurs facilement

 

Welcome to EDABoard.com

Sponsor

Back
Top