-
hc32f460 can导致单片机复位
can使能后发送数据,如果can总线上没有其他节点接收数据,单片机直接重启。接上接收设备后,单片机正常工作。can配置代码如下 //CAN Config static void App_CANCfg(void) { stc_can_init_t stcCanInit; /************************* Configure CAN1***************************/ stc_can_filter_config_t astcFilter1[1U] = { {0x1UL, 0x0000UL, CAN_ID_STD}, }; /* Initializes CAN. */ (void)CAN_StructInit(&stcCanInit); stcCanInit.stcBitCfg.u32Prescaler = 12U; stcCanInit.stcBitCfg.u32TimeSeg1 = 5U; stcCanInit.stcBitCfg.u32TimeSeg2 = 3; stcCanInit.stcBitCfg.u32SJW = 3; stcCanInit.pstcFilter = astcFilter1; stcCanInit.u16FilterSelect = CAN_FILTER1; stcCanInit.u8WorkMode = CAN_WORK_MD_NORMAL;//CAN_WORK_MD_ELB; stcCanInit.u8PTBSingleShotTx = CAN_PTB_SINGLESHOT_TX_ENABLE; stcCanInit.u8STBSingleShotTx = CAN_STB_SINGLESHOT_TX_ENABLE; stcCanInit.u8STBPrioMode = CAN_STB_PRIO_MD_DISABLE; stcCanInit.u8RxWarnLimit = 10U; stcCanInit.u8ErrorWarnLimit = 15U; stcCanInit.u8RxAllFrame = CAN_RX_ALL_FRAME_DISABLE; stcCanInit.u8RxOvfMode = CAN_RX_OVF_DISCARD_NEW; stcCanInit.u8SelfAck = CAN_SELF_ACK_DISABLE; /* Enable peripheral clock of CAN. */ FCG_Fcg1PeriphClockCmd(FCG1_PERIPH_CAN, ENABLE); (void)CAN_Init(CM_CAN, &stcCanInit); CAN_ExitLocalReset(CM_CAN); /* Enable the interrupts, the status flags can be read. */ CAN_IntCmd(CM_CAN, CAN_INT_ALL, DISABLE); CAN_IntCmd(CM_CAN, CAN_INT_ERR_INT|CAN_INT_RX_BUF_WARN|CAN_INT_RX|CAN_INT_BUS_ERR, ENABLE); }
4757浏览量 13回复量 关注量 -
求教CAN的字节序问题
CAN的扩展帧ID和数据帧都要进行大小端的转换吗?如帧ID是0x12345678 是不是要转成0x78563412 那么8位帧数据呢? 如01 23 45 67 89 AB CD EF 是不是要转成 EF CD AB 89 67 45 23 01 求指教?
10455浏览量 9回复量 关注量 -
GD32C103CBT6的CAN1工作不正常
参考官方例程communication_FDmode,CAN1_TX只会出现一两个低脉冲。直接用例程去掉按键、加个50ms延时周期发送也是一样的波形. [img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABIMAAACDCAIAAACRJkyzAAAgAElEQVR4Ae2dz48cx5Xn+z9gVwMsSdVFZqtpjinv2lqrtTPi7sy0d60GpDHWvrT+gRmg0bQgGBLMg+AGhpe5GChJaFkFGwNDHp4GKwzQRxGgAFGibgNQTbKZF58M2D5Kuvi8qwr1V1+9iIyKrPxRWdXfBEG8ePGNFy8+EVmdj1VdXMk6cH308d0OZLEAKQhU+iaJlVilE0hU6lAlgsqyTKzEKp1AolKHKhGUbsB0UGKVzqqWG/DJ0yt93qVXrnRhhbXsbhcW0nQOApVOWKzEKp1AolKHKhGUHm7SQYlVOivdgGKVTiBdqXOVyKoWUKeF2JOJk54FmSqxRdrlWm6DRVpwhVzFKh2eWCWyEqhEUKou0kGJVTor3YBilU4gXalzlciqFlCqxHzaqsR8Jt311HIbdHd5tWYmVuk4xSqRlUAlglJ1kQ5KrNJZ6QYUq3QC6Uqdq0RWtYBSJebT/kYlFqesXuATCqCY+hghVmLFBNiOnI1Il44cMxQN0TAEuBm5jyJdOlTMUDREwxDgZuQ+inSd5UNVqhI7f/58r9c7V/laW1vr9/sXLlzgvYPdziyYzjdUiflMvvJE7qJI11m+wYIoxYqxiEYiDYFKBKUXHAYlGuk0dIsxK9EQDSbA9sxnY+aBy/06lliJra+vr66uDgaDovKJ92iqPRwOB4OBC8jidmbhGYO2KrEgli+dkbso0hUfqF6DWyQZiGiAhlAAhV40GIVo1EVDtxiTFA3RYAJsz3w2Zh643K9yiZWYXzXxpsxmD4fDXq/HY9uZhWcM2qrEgli+dEbuokhXfKB6DW6RZCCiARpCARR60WAUolEXDd1iTFI0RIMJsD3z2Zh54H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mVz/9fT67uT63uR6+vT6b5Pr+6fXM5Nr6/R6dnL999PrryfX35xez02uq6fX/5hc/3Ny/e3p9Xen199Pru3J9QO6/tfk+t+T64c//KEqsWyOV6laopR4jotqbWoBaQ21JhIBERABERABERCBigRUif3gBz9QJVbxFNU5vFQtUUpcZ5ZdjSUgXd0Z5SUCIiACIiACIiACloAqMVVi9kzMt12qliglnu+62pldQNrhrFlEQAREQAREQAREoDoBrsSqR1uOCPp04jz3sVQtUUo8z1W1NbeAtEVa84iACIiACIiACIhAVQKqxHyCqsR8Ju15StUSpcTtrWF+MwnI/NhrZhEQAREQAREQAREoR0CVmM9LlZjPpD1PqVqilLi9NcxvJgGZH3vNLAIiIAIiIAIiIALlCKgS83mpEvOZtOcpVUuUEre3hvnNJCDzY6+ZRUAEREAEREAERKAcAVViPq9OV2J//NOfP/r47hL/+eOf/uxvSZFn6WmU3ehS9Iqoyi8CIiACIiACIiACItACAVViPuROV2J+uvKIgAiIgAiIgAiIgAiIgAgsHAFVYv6WqRLzmcgjAiIgAiIgAiIgAiIgAiJQJwFVYj5NVWI+E3lEQAREQAREQAREQAREQATqJKBKzKepSsxnIo8IiIAIiIAIiIAIiIAIiECdBEpVYufPn+/1eucqX2tra/1+/8KFC8GVtDNLcGrnVCUWgaMuERABERABERABERABERCBGggkVmLr6+urq6uDwaCofCqVynA4HAwGLiAPbGcWnjFoqxILYpFTBERABERABERABERABESgNgKJlZhfNVXPYDgc9no9jtPOLDxj0FYlFsQipwiIgAiIgAiIgAiIgAiIQG0Evn16RSKeP39+MBhEBDN3PfHEE/1+3w1vZ5aUVFWJpVCSRgREQAREQAREQAREQAREYHYCp4XYtyMher1eLR9K9Ke4ePHi6uqq87czi5+D71El5jORRwREQAREQAREQAREQAREoE4CKZXYuXPn6pzym7EQHMY3++tplQquSqwe6IoiAiIgAiIgAiIgAiIgAiJQRKCuSmxzc3N3d3dvb+/65Nrb29vd3d3c3CyaF37USDDQ5YwPPvggn1w3b97krmvXruV5/rvf/e7/O999991f/epXTz75JAvYLgrOGtiqxIBChgiIgAiIgAiIgAiIgAiIQCMEaqnEtre3j46OxuPx8fHxw8l1fHw8Ho+Pjo62t7fjeaNGgmH0rgzL8/z999/nrtdffz3P86OjoyzL3n///TzPf/GLX7CA7aLgrIGtSgwoZIiACIiACIiACIiACIiACDRCoHoldnh4eHBwcHJygpIJxsnJycHBweHhYSR11EgwjBjRplZiJycnP/nJT8xw1ywKDvFnn38BW5UYUMgQAREQAREQAREQAREQARFohEDFSmx7e/vg4MAVS59++unbb7/96eRyhvMfHBxE3hlDjQTDrLOoEvvRj37061//+mc/+xneE8vz/Pbt22a4axYFh/izz79wf7IsUyUGLDJEQAREQAREQAREQAREQAQaIVClEtvc3Dw6OnLvht2+ffu5557Lsuw/J1eWZVevXr19+3ae5ycnJ0dHR0W/M4YaCYZZJyqxDz/88P8UXB9++CFkZrhrFgV3vXhDzBmqxIIM5RQBERABERABERABERABEaiNQJVKbHd3dzwe53l+//59V4ZxJeaKsQcPHuR5Ph6Pd3d3g0mjRoJhZCixEg0z3DWLgmdZZsowvScWBCinCIiACIiACIiACIiACIhAnQSqVGJ7e3vHx8d5nr/55pvICe+JOc9bb72V5/nx8fHe3h40bKBGgsG9WZYlFmCQmeGuWRTc9eKjic7Qe2JBhnKKgAiIgAiIgAiIgAiIgAjURqBKJXb9+vWHDx/meX7t2jWX0Isvvnh/cr3wwgvO475r/uHDh9evXw8mjRoJhpGhxEo0zHDXLAruet3bYvhblViQoZwiIAIiIAIiIAIiIAIiIAK1EairEtva2nKfVES9NB6Pt7a26qrE3nvvvX+LXu+9956bOohmaiXGb4upEgsylFMEREAEREAEREAEREAERKA2AlUqMXw68datW/fu3cvz/O7du/80uT755JM8z+/du3fr1q1aPp24s7MTX/POzk6VSgy/MPbZ51+oEoujVq8IiIAIiIAIiIAIiIAIiEBVAlUqMXxjh/vSjhs3bly5csUldOXKlRs3bty/f99VR9W/sWNnZ+fll1/+BV0///nPn3zySay/YiWm98RAUoYIiIAIiIAIiIAIiIAIiEDjBKpUYvwt9nfu3Hn++ec53Z2dnTt37tT1LfY7Ozvud9Lw6cc8z59++mnMWLES03tiIClDBERABERABERABERABESgcQJVKrEsy/h/dn7w4MF4PH5lco3HY/f99Xme1/I/O+/s7PzmN7/5v3TdvHnz8uXLAKRKDChkiIAIiIAIiIAIiIAIiIAIdJ1AxUosy7LDw8ODgwP3/zvzG1bu3bCDg4PDw8MIBXyXBgwjdjGb+z0x/H9i7m2xr39P7NVXX3OpyMiyTBAEQbeD7gLdBboLdBfoLtBdoLtAd0GNd0H1Ssy9M3Z0dDQej4+Pjx9OruPj4/F4fHR0tL297bIt+hsFGAyjdJXYG2+8Qb8jFjDfeOMNpzTDXbMoeFCsb+wIYpFTBERABERABERABERABESgNgK1VGJZlm1ubu7u7u7t7V2fXHt7e7u7u5ubm1MTRY0Ewwz54IMPzFttkeaHH35ohrtmUfCgWJVYEIucIiACIiACIiACIiACIiACtRG4cnpFIpYqYyJxgl0IDiMoq+gsFVyVWEXaGi4CIiACIiACIiACIiACIjCFwGkh9tW3zwfVa2trw+Ew2FXRORwO19bWXJB2ZklJ+P8B2ul7Pttq3JIAAAAASUVORK5CYII=[/img]
5809浏览量 4回复量 关注量 -
can通讯相关问题
n32g430使用can例程进行相关测试,can数据分析仪,发送数据失败接收数据也失败,加了个收发器TJA1043T3将stb对应引脚拉低也不能进行通讯,请问大伙知道是什么原因吗?求求求
1224浏览量 2回复量 关注量 -
HC32F460采用CAN通讯时发送错误计数突然增加是怎么回事?
TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 132. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 131. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 131. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 130. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 130. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 129. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 129. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 128. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 128. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. [b]RxErrorCount = 0,TxErrorCount = 127.[/b] [b]TEC or REC reached warning limit.[/b] [b]RxErrorCount = 0,TxErrorCount = 127.[/b] can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. [b]RxErrorCount = 0,TxErrorCount = 190.[/b] [b]TEC or REC reached warning limit.[/b] [b]RxErrorCount = 0,TxErrorCount = 190.[/b] can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 189. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 189. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 188. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 188. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 187. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 187. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 186. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 186. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 185. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 185. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 184. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 184. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 183. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 183. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 190. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 190. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 189. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 189. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 188. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 188. can decode 6,96 curvedate:4 curvedate:4 PTB transmitted. TEC or REC reached warning limit. RxErrorCount = 0,TxErrorCount = 187. 如上面log,CAN通讯时,错误计数突然从127增加到190,有人知道是什么原因吗?
1584浏览量 1回复量 关注量 -
小华单片机HC32F460的跑官方例程时会发送不成功
目前在调试HC32F460时会卡在如下代码:在[color=rgb(197, 134, 192)][backcolor=rgb(30, 30, 30)][font=Consolas, "]while[/font][/backcolor][/color][color=#d4d4d4][backcolor=rgb(30, 30, 30)][font=Consolas, "] ([/font][/backcolor][/color][color=rgb(220, 220, 170)][backcolor=rgb(30, 30, 30)][font=Consolas, "]CAN_GetStatus[/font][/backcolor][/color][color=#d4d4d4][backcolor=rgb(30, 30, 30)][font=Consolas, "]([/font][/backcolor][/color][color=rgb(86, 156, 214)][backcolor=rgb(30, 30, 30)][font=Consolas, "]CAN_UNIT[/font][/backcolor][/color][color=#d4d4d4][backcolor=rgb(30, 30, 30)][font=Consolas, "], CAN_FLAG_STB_TX) == [/font][/backcolor][/color][color=rgb(79, 193, 255)][backcolor=rgb(30, 30, 30)][font=Consolas, "]RESET[/font][/backcolor][/color][color=#d4d4d4][backcolor=rgb(30, 30, 30)][font=Consolas, "]) { }[/font][/backcolor][/color],哪位大佬可以指点一下吗?[color=#d4d4d4][backcolor=rgb(30, 30, 30)][font=Consolas, "][color=#569cd6]static[/color] [color=#569cd6]void[/color] [color=#dcdcaa]CanTx[/color]([color=#569cd6]void[/color]) { [color=#569cd6]uint8_t[/color] [color=#9cdcfe]i[/color]; [color=#569cd6]static[/color] [color=#569cd6]uint8_t[/color] [color=#9cdcfe]u8Data[/color]; [color=#c586c0]for[/color] ([color=#9cdcfe]i[/color] = [color=#b5cea8]0U[/color]; [color=#9cdcfe]i[/color] < [color=#569cd6]CAN_TX_DATA_SIZE[/color]; [color=#9cdcfe]i[/color]++) { [color=#9cdcfe]m_stcTx1[/color].[color=#9cdcfe]au8Data[/color][[color=#9cdcfe]i[/color]] = [color=#9cdcfe]u8Data[/color]++; [color=#9cdcfe]m_stcTx2[/color].[color=#9cdcfe]au8Data[/color][[color=#9cdcfe]i[/color]] = [color=#9cdcfe]u8Data[/color]++; [color=#9cdcfe]m_stcTx3[/color].[color=#9cdcfe]au8Data[/color][[color=#9cdcfe]i[/color]] = [color=#9cdcfe]u8Data[/color]++; } [color=#6a9955] /* Frame with CAN_ID1 */[/color] [color=#9cdcfe]m_stcTx1[/color].[color=#9cdcfe]u32Ctrl[/color] = [color=#b5cea8]0x0UL[/color]; [color=#9cdcfe]m_stcTx1[/color].[color=#9cdcfe]u32ID[/color] = [color=#569cd6]CAN_TX_ID1[/color]; [color=#9cdcfe]m_stcTx1[/color].[color=#9cdcfe]IDE[/color] = [color=#569cd6]CAN_TX_ID1_IDE[/color]; [color=#9cdcfe]m_stcTx1[/color].[color=#9cdcfe]DLC[/color] = [color=#569cd6]CAN_TX_DLC[/color]; ([color=#569cd6]void[/color])[color=#dcdcaa]CAN_FillTxFrame[/color]([color=#569cd6]CAN_UNIT[/color], CAN_TX_BUF_PTB, &[color=#9cdcfe]m_stcTx1[/color]); [color=#6a9955] /* Start PTB TX */[/color] [color=#dcdcaa]CAN_StartTx[/color]([color=#569cd6]CAN_UNIT[/color], CAN_TX_REQ_PTB); [color=#6a9955] /* Check transmission end. */[/color] [color=#c586c0]while[/color] ([color=#dcdcaa]CAN_GetStatus[/color]([color=#569cd6]CAN_UNIT[/color], CAN_FLAG_PTB_TX) == [color=#4fc1ff]RESET[/color]) { } [color=#dcdcaa]CAN_ClearStatus[/color]([color=#569cd6]CAN_UNIT[/color], CAN_FLAG_PTB_TX); [color=#6a9955] /* Frame with CAN_ID2 */[/color] [color=#9cdcfe]m_stcTx2[/color].[color=#9cdcfe]u32Ctrl[/color] = [color=#b5cea8]0x0UL[/color]; [color=#9cdcfe]m_stcTx2[/color].[color=#9cdcfe]u32ID[/color] = [color=#569cd6]CAN_TX_ID2[/color]; [color=#9cdcfe]m_stcTx2[/color].[color=#9cdcfe]IDE[/color] = [color=#569cd6]CAN_TX_ID2_IDE[/color]; [color=#9cdcfe]m_stcTx2[/color].[color=#9cdcfe]DLC[/color] = [color=#569cd6]CAN_TX_DLC[/color]; ([color=#569cd6]void[/color])[color=#dcdcaa]CAN_FillTxFrame[/color]([color=#569cd6]CAN_UNIT[/color], CAN_TX_BUF_STB, &[color=#9cdcfe]m_stcTx2[/color]); [color=#6a9955] /* Frame with CAN_ID3 */[/color] [color=#9cdcfe]m_stcTx3[/color].[color=#9cdcfe]u32Ctrl[/color] = [color=#b5cea8]0x0UL[/color]; [color=#9cdcfe]m_stcTx3[/color].[color=#9cdcfe]u32ID[/color] = [color=#569cd6]CAN_TX_ID3[/color]; [color=#9cdcfe]m_stcTx3[/color].[color=#9cdcfe]IDE[/color] = [color=#569cd6]CAN_TX_ID3_IDE[/color]; [color=#9cdcfe]m_stcTx3[/color].[color=#9cdcfe]DLC[/color] = [color=#569cd6]CAN_TX_DLC[/color]; ([color=#569cd6]void[/color])[color=#dcdcaa]CAN_FillTxFrame[/color]([color=#569cd6]CAN_UNIT[/color], CAN_TX_BUF_STB, &[color=#9cdcfe]m_stcTx3[/color]); [color=#6a9955] /* Start STB TX */[/color] [color=#dcdcaa]CAN_StartTx[/color]([color=#569cd6]CAN_UNIT[/color], CAN_TX_REQ_STB_ALL); [color=#6a9955] /* Check transmission end. */[/color] [color=#c586c0]while[/color] ([color=#dcdcaa]CAN_GetStatus[/color]([color=#569cd6]CAN_UNIT[/color], CAN_FLAG_STB_TX) == [color=#4fc1ff]RESET[/color]) { } [color=#dcdcaa]CAN_ClearStatus[/color]([color=#569cd6]CAN_UNIT[/color], CAN_FLAG_STB_TX); } [/font][/backcolor][/color]
1682浏览量 6回复量 关注量 -
GD32E103 CAN 功能收发问题 sos
诸位兄弟姐们打扰了,最近在测试GD32e103的can功能, 根据资料范例程序和网上相关帖子测试程序收发均有问题, 希望哪位兄弟有成功经验的能够传授一下,甚是感谢!!!
1753浏览量 0回复量 关注量 -
AC7801X CAN ID设置后 有问题
参考 官方例程改的 不知道是哪里没有设置对 过滤ID有问题 前面两个ID一直收不到 (使用的是回环模式) CAN_MsgInfoType g_sendCANMsgInfo; CAN_MsgInfoType g_recvCANMsgInfo; CAN_FilterControlType canFilterControl01[]= { {0, ENABLE, CAN_ID_1, 0x00000000}, ///<Ö»½ÓÊÕ0x400 ID }; CAN_FilterControlType canFilterControl02[]= { {1, ENABLE, CAN_ID_2, 0x00000000}, ///<Ö»½ÓÊÕ0x400 ID }; CAN_FilterControlType canFilterControl03[]= { {2, ENABLE, CAN_ID_3, 0x00000000}, ///<Ö»½ÓÊÕ0x400 ID }; CAN_FilterControlType canFilterControl04[]= { {3, ENABLE, CAN_ID_4, 0x00000000}, ///<Ö»½ÓÊÕ0x400 ID }; CAN_FilterControlType canFilterControl05[]= { {4, ENABLE, CAN_ID_5, 0x00000000}, ///<Ö»½ÓÊÕ0x400 ID }; CAN_FilterControlType canFilterControl06[]= { {5, ENABLE, CAN_ID_6, 0x00000000}, ///<Ö»½ÓÊÕ0x400 ID }; u8 sendDataBuff[CAN_SEND_LENGTH] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}; u8 recvDataBuff[CAN_RECIEVE_LENGTH] = {0}; u8 can_recieve_buffer[CAN_RECIEVE_LENGTH] = {0}; void CAN0_IRQnCallBack(void *device, uint32_t wpara, uint32_t lpara); void CAN0_gpio_init(void) { CKGEN_Enable(CLK_CAN0, ENABLE); GPIO_SetFunc(GPIOB, GPIO_PIN0, GPIO_FUN3);//CAN0_TX GPIO_SetFunc(GPIOB, GPIO_PIN1, GPIO_FUN3);//CAN0_RX // GPIO_SetFunc(GPIOC, GPIO_PIN8, GPIO_FUN0);//CAN0_STB // GPIO_SetDir(GPIOC, GPIO_PIN8, GPIO_OUT);//ÉèÖÃCAN0ÊÕ·¢Æ÷¿ØÖÆΪIO¿ØÖÆ //CAN0_TRASCVER_NML;//ʹÄÜCANÊÕ·¢Æ÷ // GPIO_SetPinLevel(GPIOC, GPIO_PIN8, GPIO_LEVEL_LOW); } void CAN_InitHardwr(void) { CAN_ConfigType canConfig; CAN_BitrateConfigType canBandrateConfig; //CAN_FilterControlType CAN_FilterControlTypedef; CAN0_gpio_init(); /* ÉèÖò¨ÌØÂÊΪ500K,²ÉÑùµãΪ81.25%. tSeg1 = (S_SEG_1 + 2); tSeg2 = (S_SEG_2 + 1). BandRate = (48M / (S_PRESC + 1) / ((S_SEG_1 + 2) + (S_SEG_2 + 1))) SamplePoint = (tSeg1 / (tSeg1 + tSeg2)). ÔÚÒѾ֪µÀ²¨ÌØÂÊÓë²ÉÑùµãµÄÇé¿öÏÂ,¾¹ý¼ÆËãºó:tSeg1 = 13,tSeg2 = 3. */ canBandrateConfig.PRESC = 11;//·ÖƵºóʱÖÓΪ8M. canBandrateConfig.SEG_1 = 11; canBandrateConfig.SEG_2 = 2; canBandrateConfig.SJW = 2;//Âú×ãS_SJW <= tSeg2¼´¿É. canConfig.interruptMask = CAN_IRQ_ALL_ENABLE_MSK; //´ò¿ªËùÓÐÖÐ¶Ï canConfig.canMode = CAN_MODE_LOOPBACK_INTERNAL;//CAN_MODE_NORMAL;// canConfig.clockSrc = CAN_CLKSRC_AHB; canConfig.tsMode = CAN_TSMODE_FIFO; canConfig.tsAmount = CAN_TRANSMIT_ONE; canConfig.interruptEn = ENABLE;//ʹÄÜÖÐ¶Ï canConfig.tpss = DISABLE; canConfig.tsss = ENABLE; canConfig.timeStampEn = DISABLE; /*!< Time stamp enable */ canConfig.timeStampClk = CAN_TIME_CLK_DIVIDER_8; /*!< Time stamp clock */ canConfig.timeStampPos = CAN_TIME_STAMP_SOF; /*!< Time stamp position */ canConfig.rom = CAN_RECV_OVER_WRITE; canConfig.selfAckEn = DISABLE; /*!< Self-Acknowledge enable(when LBME=1) */ canConfig.fdModeEn = DISABLE; /*!< FD enable */ canConfig.fdIsoEn = DISABLE; /*!< FD ISO mode */ canConfig.tdcEnable = DISABLE; canConfig.filterNum = 0; //canConfig.filterList = &CAN_FilterControlTypedef; canConfig.filterList = canFilterControl01;//¸³Öµ¹ýÂËÆ÷ÉèÖÃlist canConfig.callback = CAN0_IRQnCallBack; canConfig.normalBitrate = &canBandrateConfig; g_sendCANMsgInfo.DATA = sendDataBuff; g_recvCANMsgInfo.DATA = recvDataBuff; CAN_Init(CAN0, &canConfig); canConfig.filterNum = 1; canConfig.filterList = canFilterControl02; CAN_Init(CAN0, &canConfig); canConfig.filterNum = 2; canConfig.filterList = canFilterControl03; CAN_Init(CAN0, &canConfig); canConfig.filterNum = 3; canConfig.filterList = canFilterControl04; CAN_Init(CAN0, &canConfig); canConfig.filterNum = 4; canConfig.filterList = canFilterControl05; CAN_Init(CAN0, &canConfig); canConfig.filterNum = 5; canConfig.filterList = canFilterControl06; CAN_Init(CAN0, &canConfig); } void CAN_send_data(u32 ID, u8 *buffer) { g_sendCANMsgInfo.ID = ID; g_sendCANMsgInfo.IDE = 1; g_sendCANMsgInfo.DLC = 8; for (u8 a=0; a
1138浏览量 2回复量 关注量 -
为何GD32E103最新的固件库中CAN相关的都没有了
最近使用GD32E103的can,使用的1.0.0的固件库发现在CAN和CANFD混用的时候相关操作函数有些BUG,然后下载了1.2.0的库发现can相关的东西完全没有了
2973浏览量 4回复量 关注量 -
【求助】请问CC2540 怎么在广播里面广播出mac地址啊? sos
各位大神, 请问怎么在广播里面广播出mac地址? 我自己的想法是,先获取到mac地址,再把mac地址添加到scanRspData[]中? 但是我在使用GAPRole_GetParameter的时候,在蓝牙状态改变的回调函数中可以正常使用,在其他地方就不行。 请问还有什么方法可以获取吗?
1340浏览量 0回复量 关注量