在线时间0 小时
UID258767
ST金币0
蝴蝶豆0
注册时间2011-1-10
初级会员
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
STM32F103C6 用 CAN 例子程序的 查询方式是可以发送 用 USB CAN 能够接受到数据 , 例子是100K 而,实际是50K , 当改动 CAN_InitStructure.CAN_Prescaler=1; 应该是250K 可以用 USB CAN 接受不到数据
晶体是8M HZ
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Select HSE as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_HSE);
/* Wait till HSE is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x04)
{
}
CAN_InitStructure.CAN_TTCM=DISABLE;
CAN_InitStructure.CAN_ABOM=DISABLE;
CAN_InitStructure.CAN_AWUM=DISABLE;
CAN_InitStructure.CAN_NART=DISABLE;
CAN_InitStructure.CAN_RFLM=DISABLE;
CAN_InitStructure.CAN_TXFP=DISABLE;
// CAN_InitStructure.CAN_Mode=CAN_Mode_LoopBack;
CAN_InitStructure.CAN_Mode=CAN_Mode_Normal;
CAN_InitStructure.CAN_SJW=CAN_SJW_1tq;
CAN_InitStructure.CAN_BS1=CAN_BS1_8tq;
CAN_InitStructure.CAN_BS2=CAN_BS2_7tq;
// CAN_InitStructure.CAN_Prescaler=5; //50K
CAN_InitStructure.CAN_Prescaler=1; //250K
CAN_Init(&CAN_InitStructure);
哪位大虾 能够帮帮啊??????????????????????????
|
|