ST意法半导体
直播中

赵淑洁

7年用户 910经验值
私信 关注
[问答]

stm8s208 can没有发出时间戳的原因?

需要发送一个标准数据帧,DLC为8,使用下面函数开启时间触发通讯模式,串口打印确认TTCM和TGT位置1,而且发送时间戳寄存器有数据变化,但是没有发出时间戳。
void CAN_TTComModeCmd(FunctionalState NewState)
{
CAN_Page_TypeDef can_page = CAN_GetSelectedPage();
/[i] Check the parameters /
assert_param(IS_FUNCTIONALSTATE_OK(NewState));
if (NewState != DISABLE)
{
/[i]Enable the TTCM mode /
CAN->MCR |= CAN_MCR_TTCM;
/[i]Set TGT bits setting in Tx and FIFO pages/
CAN->PSR = CAN_Page_TxMailBox0;
CAN->Page.TxMailbox.MDLCR |= CAN_MDLCR_TGT;
CAN->PSR = CAN_Page_TxMailBox1;
CAN->Page.TxMailbox.MDLCR |= CAN_MDLCR_TGT;
CAN->PSR = CAN_Page_TxMailBox2;
CAN->Page.TxMailbox.MDLCR |= CAN_MDLCR_TGT;
CAN->PSR = CAN_Page_RxFifo;
CAN->Page.RxFIFO.MDLCR |= CAN_MDLCR_TGT;}




更多回帖

发帖
×
20
完善资料,
赚取积分