2019-07-23 06:30 AM
Hi,
I am using STM32F103RFT6 64 pin package mcu. i am seeing can bit stuff error during CAN2 TX pin ( PB9) initialization. when mcu is in reset state this pin is in high state, the moment CANTX pin gets configure to Alternate function pushpul, Low signal is detected until CAN1 Clock is enabled. this is causing stuff error on CAN BUS.
<code>
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
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);
/*_____Configure_CAN_pin:_RX _as_input_floating__________*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_CAN_RX;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(GPIO_CAN, &GPIO_InitStructure);
GPIO_PinRemapConfig(GPIO_Remap1_CAN1, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1, ENABLE);
<code>
Please find attached oscilloscope screen shots for details.
why CAN TX Pin is getting Low?