我的cy8c29866程序进不了I/O中断,但是能够进入UART中断,希望有人能够帮忙解决,在下感激不尽。 我的相关程序如下: boot.asm中的中断设置为: org 1Ch ;GPIO Interrupt Vector ljmp PSoC_GPIO_ISR reti 在device editor中将要产生中断的端口POO设置为: stdcpu HighZ RisingEdge,然后点击了generate applaction按钮 main.c为: #include <m8c.h> // part specific constants and macros #include "PSoCAPI.h" // PSoC API definitions for all User Modules #pragma interrupt_handler UART_TX_ISR #pragma interrupt_handler UART_RX_ISR #pragma interrupt_handler PSoC_GPIO_ISR #define Port6 PRT6DR #define over (PRT0DR&0x04)>>2 #define EN_1 PRT0DR=PRT0DR|0x50 #define EN_0 PRT0DR=PRT0DR&0xaf #define CLK_0 PRT2DR=PRT2DR&0xfa #define CLK_1 PRT2DR=PRT2DR|0x05 #define WR_W PRT2DR=PRT2DR|0x50 #define WR_R PRT2DR=PRT2DR&0xaf unsigned char cmd=0; unsigned char flag_wr=0; unsigned char start=0; unsigned char databuffer[160]; unsigned char row_finish=0; unsigned char counter_collum=0; unsigned char counter_row=0; void UART_TX_ISR(void) { UART_1_PutChar(over); } void UART_RX_ISR(void) { cmd=UART_1_cGetChar( ); if (cmd==0xe2)UART_1_PutChar(over); } void PSoC_GPIO_ISR(void) {EN_1;CLK_0;WR_W; } void main() { UART_1_CmdReset(); UART_1_IntCntl(UART_1_ENABLE_RX_INT|UART_1_ENABLE_TX_INT); // Enable RX&TX interrupts UART_1_Start(0x00); // Enable UART M8C_EnableIntMask(INT_MSK0,INT_MSK0_GPIO); //以下四条注释掉的语句为自己的I/O中断的配置,不能够进入中断,后来换 // 为了M8C_EnableIntMask(INT_MSK0,INT_MSK0_GPIO)但是仍然不行 // PRT0IC0=0X00;//P102 int mode // PRT0IC1=0X04; // PRT0IE=0X04;//INT ENABLE P142 // INT_MSK0=0X20;//MASK M8C_EnableGInt ; // Turn on interrupts cmd=0xe2; while(1); } |