外部按键中断时无法触发中断

[复制链接]
1016|13
 楼主| gongche 发表于 2014-12-15 20:04 | 显示全部楼层 |阅读模式
用cy7c63813芯片的INT0引脚做外部按键中断时,无法触发中断,但是GIE使能、INT0中断使能、引脚配置(开漏、下降沿触发)等都没问题
huwr 发表于 2014-12-15 20:09 | 显示全部楼层
在boot.asm替换了中断向量表中的中断服务程序为_button_svr了吗?
 楼主| gongche 发表于 2014-12-15 20:10 | 显示全部楼层
替换了
huanghuac 发表于 2014-12-15 20:12 | 显示全部楼层
代码发一下看看
 楼主| gongche 发表于 2014-12-15 20:14 | 显示全部楼层
#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules

#pragma interrupt_handler button_svr

void main()
{
     // Insert your main routine code here.
DWORD count = 0;
M8C_EnableGInt;
M8C_EnableIntMask( INT_MSK0, INT_MSK0_GPIO_PORT0 );

while(1)
{}
}

void button_svr(void)
{
if(P1DATA == 0x00)
   P1DATA = 0x04;
else
   P1DATA = 0x00;
}
 楼主| gongche 发表于 2014-12-15 20:29 | 显示全部楼层
这是电路图
happy_10 发表于 2014-12-15 20:31 | 显示全部楼层
要在boot.tpl中修改中断返回服务程序, 而不能在boot.asm中改
 楼主| gongche 发表于 2014-12-15 20:33 | 显示全部楼层
试了下楼上的方法,还是没有解决
huanghuac 发表于 2014-12-15 20:34 | 显示全部楼层
生成hex的时候要选择reloadboot.asm
冰清玉洁 发表于 2014-12-15 20:35 | 显示全部楼层
reloadboot.asm文件在什么地方啊?
wenfen 发表于 2014-12-15 20:36 | 显示全部楼层
生成hex文件时候如何在那一个菜单里面选择reloadboot.asm呢?
chenho 发表于 2014-12-15 20:38 | 显示全部楼层
在boot.tpl中修改中断返回服务程序后,打开一下boot.asm, 看相应的修改产生了没?
http://www.cypress.com/?rID=48990
这个是一个例程
 楼主| gongche 发表于 2014-12-15 20:39 | 显示全部楼层
多谢楼上,搞通了
 楼主| gongche 发表于 2014-12-15 23:02 | 显示全部楼层
结贴了,晚安哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则

768

主题

9410

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部