so quero receber um dado pela serial via interrupçao onde estou errando ???
o ARM é o LPC2138 simulando no proteus
- Código: Selecionar todos
// UART1 interrupt service function
//******************************************************************************/
__irq void UART1_int (void) {
/* write code here */
Fusart1=1;
VICVectAddr = 0; /* Acknowledge Interrupt */
}
main()
{
VPBDIV = 1; /* A FREQ DOS PERIFERICOS É IGUAL AO CCLK*/
IODIR1=0xFF000000;
IOCLR1=0xFFFFFFFF;
PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */
U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
U1DLL = 78; /* 9600 Baud Rate @ 15MHz VPB Clock */
U1DLM = 0;
U1LCR = 0x03;
VICVectAddr7 = (unsigned long)UART1_int;
VICVectCntl7 = 20|7; /* use it for UART1 Interrupt */
VICIntEnable = 1 << 7; /* Enable UART1 Interrupt */
U1IER = 3;
while(1)
{
if(Fusart1)
{
Fusart1=0;
sendchar('C');
}
}
}