cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F107VC CAN bus pin remap

hello
Associate II
Posted on June 20, 2012 at 23:19

hi.

i am using the STM32F107VC board from IAR i have some example code for CAN but in my Board they used the PD0 and PD1 for CAN i dont know how to remap it in my code. i have 2 board and i want to sent data between 2 boards.

void GPIO_Configuration(void)

{

  GPIO_InitTypeDef  GPIO_InitStructure;

  

 // GPIO_PinRemapConfig(GPIO_Remap2_CAN1 , ENABLE);

  /* Configure CAN pin: RX */

  //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_CAN_RX;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;

  GPIO_Init(GPIO_CAN, &GPIO_InitStructure);

  

  /* Configure CAN pin: TX */

  //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_CAN_TX;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_Init(GPIO_CAN, &GPIO_InitStructure);

  

  GPIO_PinRemapConfig(GPIO_Remap_CAN , ENABLE);

}

can any one pls help me solve this problem..

thanks...

20 REPLIES 20
donald2
Associate II
Posted on June 28, 2012 at 02:35

To establish CAN communication you need at least two stations on a properly terminated network.  Or  simulate the transceivers with a AND gate of all Rx pins, with the AND gate output sent to all Rx pins.

If you attempt to transmit with no transceiver you'll immediately max out the error counter.