专家
公告
财富商城
电子网
旗下网站
首页
问题库
专栏
标签库
话题
专家
NEW
门户
发布
提问题
发文章
IAR的问题!
2019-03-24 14:22
发布
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
站内问答
/
TI MCU
3197
5
1724
急,请教了! 程序写好了,之前用MSP430F2132写的,调试完全ok,但是转用芯片MSP430G2201后,调试的时候设置断点居然跳出提示:Could not run device(to breakpoint).请问这是为什么呢? 此帖出自
小平头技术问答
友情提示:
此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
5条回答
零晨
1楼-- · 2019-03-24 22:56
自己先顶起来,请教高手啊!
加载中...
零晨
2楼-- · 2019-03-25 02:29
< :TI_MSP430_内容页_SA7 --> 这是我写的识别和单击和双击的程序,发现MCU老是会reset, 跑不下去,不知道为什么,求高手指教!
void Task_PortMonitor(void)
{
switch(ClickvalueTemp)
{
default:
{
break;
}
case NOCLICK:
{
if(!(P1IN & BIT3))
{
if(PortAction == KEEPACTION)
{
PortAction = SWITCHACTION;
PortCounter = 0u;
Standbycounter = 0u;
}
if(PortAction == SWITCHACTION)
{
if(PortCounter > 5000u)
{
ClickvalueTemp = SINGLECLICK;
}
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
else
{
PortAction = KEEPACTION;
PortCounter = 0u;
Standbycounter = 0u;
}
break;
}
case SINGLECLICK:
{
if(!(P1IN & BIT3))
{
if(PortAction == RETURNACTION)
{
PortAction = SWITCHACTION;
}
else if(PortAction == KEEPACTION)
{
PortAction = TWICESWITCHACTION;
PortCounter = 0u;
//Standbycounter = 0u;// ?
}
else if(PortAction == TWICESWITCHACTION)
{
if(PortCounter > 5000u)
{
ClickvalueTemp = DOUBLECLICK;
}
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
else
{
if(PortAction == SWITCHACTION)
{
PortAction = RETURNACTION;
SingleclickCounter = 0u;
PortCounter = 0u;
}
else if(PortAction == RETURNACTION)
{
if(PortCounter > 5000u)
{
PortAction = KEEPACTION; /* First click is finished */
}
}
else if(PortAction == KEEPACTION)
{
if(SingleclickCounter > 9u)
{
Clickvalue = SINGLECLICK; /* After single-click, wait for 500ms to confirm single-click */
ClickvalueTemp = NOCLICK; /* Wait for 500ms, no action on switch, return to initial status */
}
}
if(PortCounter > 5000u)
{
SingleclickCounter ++;
Standbycounter ++;
PortCounter = 0u;
}
}
break;
}
case DOUBLECLICK:
{
if(!(P1IN & BIT3))
{
if(PortAction == RETURNACTION)
{
PortAction = TWICESWITCHACTION;
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
else
{
if(PortAction == TWICESWITCHACTION)
{
PortAction = RETURNACTION;
PortCounter = 0u;
}
else if(PortAction == RETURNACTION)
{
if(PortCounter > 5000u)
{
Clickvalue = DOUBLECLICK;
PortAction = KEEPACTION;
ClickvalueTemp = NOCLICK;
}
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
break;
}
}
}
加载中...
零晨
3楼-- · 2019-03-25 05:35
精彩回答 2 元偷偷看……
加载中...
零晨
4楼-- · 2019-03-25 10:08
版主,大神,江湖救急啊!
加载中...
零晨
5楼-- · 2019-03-25 13:52
先提示could not single step device, 然后MCU就reset了!
加载中...
一周热门
更多
>
相关问题
相关文章
×
关闭
采纳回答
向帮助了您的网友说句感谢的话吧!
非常感谢!
确 认
×
关闭
编辑标签
最多设置5个标签!
保存
关闭
×
关闭
举报内容
检举类型
检举内容
检举用户
检举原因
广告推广
恶意灌水
回答内容与提问无关
抄袭答案
其他
检举说明(必填)
提交
关闭
×
关闭
您已邀请
15
人回答
查看邀请
擅长该话题的人
回答过该话题的人
我关注的人
void Task_PortMonitor(void)
{
switch(ClickvalueTemp)
{
default:
{
break;
}
case NOCLICK:
{
if(!(P1IN & BIT3))
{
if(PortAction == KEEPACTION)
{
PortAction = SWITCHACTION;
PortCounter = 0u;
Standbycounter = 0u;
}
if(PortAction == SWITCHACTION)
{
if(PortCounter > 5000u)
{
ClickvalueTemp = SINGLECLICK;
}
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
else
{
PortAction = KEEPACTION;
PortCounter = 0u;
Standbycounter = 0u;
}
break;
}
case SINGLECLICK:
{
if(!(P1IN & BIT3))
{
if(PortAction == RETURNACTION)
{
PortAction = SWITCHACTION;
}
else if(PortAction == KEEPACTION)
{
PortAction = TWICESWITCHACTION;
PortCounter = 0u;
//Standbycounter = 0u;// ?
}
else if(PortAction == TWICESWITCHACTION)
{
if(PortCounter > 5000u)
{
ClickvalueTemp = DOUBLECLICK;
}
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
else
{
if(PortAction == SWITCHACTION)
{
PortAction = RETURNACTION;
SingleclickCounter = 0u;
PortCounter = 0u;
}
else if(PortAction == RETURNACTION)
{
if(PortCounter > 5000u)
{
PortAction = KEEPACTION; /* First click is finished */
}
}
else if(PortAction == KEEPACTION)
{
if(SingleclickCounter > 9u)
{
Clickvalue = SINGLECLICK; /* After single-click, wait for 500ms to confirm single-click */
ClickvalueTemp = NOCLICK; /* Wait for 500ms, no action on switch, return to initial status */
}
}
if(PortCounter > 5000u)
{
SingleclickCounter ++;
Standbycounter ++;
PortCounter = 0u;
}
}
break;
}
case DOUBLECLICK:
{
if(!(P1IN & BIT3))
{
if(PortAction == RETURNACTION)
{
PortAction = TWICESWITCHACTION;
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
else
{
if(PortAction == TWICESWITCHACTION)
{
PortAction = RETURNACTION;
PortCounter = 0u;
}
else if(PortAction == RETURNACTION)
{
if(PortCounter > 5000u)
{
Clickvalue = DOUBLECLICK;
PortAction = KEEPACTION;
ClickvalueTemp = NOCLICK;
}
}
if(PortCounter > 5000u)
{
Standbycounter ++;
PortCounter = 0u;
}
}
break;
}
}
}
一周热门 更多>