Posted on May 17, 2011 at 09:53Hi, I have to controll the port 6, pins 0 and 4, that rappresent two signal from an encoder. I try first to envelope the SW for the first port with interrupt. The problem is that don't run. Can you help me, please? this is my code: void Interrupt_encoder(void){ //GPIO6 init SCU->PRR1 |= 0x00100000; //scelgo la porta 6 SCU->PCGR1 |= 0x00100000; SCU->GPIOIN[6] |= 0x00; GPIO6->DDR=0x00; //Clock per Wiu SCU->PRR1 |= 0x00002000; SCU->PCGR1 |= 0x00002000; //Clock per Vic SCU->PRR0 |= 0x0020; SCU->PCGRO |= 0x0020; //Connect pin 6.0 to VIC1.12 SCU->WKUPSEL &= 0xFE3F; SCU->WKUPSEL |= 0x0000 ; //mette l'indirizzo dell'interrupt in VAir VIC1->VAiR[11] = (unsigned int)&prova_encoder; //enable interrupt VIC1->INTSR &= 0xEFFF; VIC1->VCiR[11] &= 0xFFC0; VIC1->VCiR[11] = 0x002C; //programma la Wiu a trasferire l'interrupt al Vic WIU->PR |= 0xFFFFFFFC; WIU->CTRL |= 0x02; WIU->MR |= 0xFFFFFFFC; //enable interrupt VIC1->INTER |= 0x0800; //interrupt11 }
so shouldn't VIC1->INTER |= 0x0800; //interrupt11 be VIC1->INTER |= 0x1000; //interrupt12 may want to use their function VIC_ITCmd(EXTIT2_ITLine, ENABLE);
I have resolved the problem trought the function of WIU and VIC library. Port 6.0 ---->interrupt16 (see manual and the Wic' example) Port 6.4 ---->interrupt20 Using thus functions ( taken advantage from the structure of the Wic' example ) the initial problem was how to run the interrupt software, and where write it. I saw that in the file 91x_IT there was declared function that are utilizable for thus, and one function of the example call it. So if you use port6, have to use EXINT2_ function and write your interrupt software. In this way is very simple. (for port5 EXINT1, for 7 EXINT3, ...) I hope that thus can be util for someone to handler in easy way the interrupt. alla regards