embpic
Advanced Member level 3
- Joined
- May 29, 2013
- Messages
- 742
- Helped
- 80
- Reputation
- 160
- Reaction score
- 77
- Trophy points
- 1,308
- Location
- india
- Activity points
- 5,213
Hi
i am currently working on Arm7 lpc2148. but right now i am doing simple task but no idea regarding interrupt handler and exception handler.
n
facing peoblem with UART0 interrupt also if any one know plz help me and my code is
no interrupt is generated and i want all three of interrupt.
thanzz in advance
i am currently working on Arm7 lpc2148. but right now i am doing simple task but no idea regarding interrupt handler and exception handler.
n
facing peoblem with UART0 interrupt also if any one know plz help me and my code is
Code:
#include<lpc214x.h>
void uart0(void)__irq;
void init_uart0(void);
void Initialize(void);
void tx(unsigned char *);
unsigned int aa,r_data;
int main(void)
{
Initialize();
tx("Hello WOrld This is LPC2148");
// tx(r_data);
while(1);
}
void Initialize(void)
{
VPBDIV = 0x00;
PINSEL0 = 0x00000005;
PINSEL1 = 0X00000000;
PINSEL2 = 0X00000000;
IO0SET = (1<<19);
IO0DIR = 0xfffffff0; //61
aa = 0;
init_uart0();
}
void init_uart0(void)
{
U0LCR = 0x83;
U0DLL = 0x61;
U0DLM = 0x00;
U0FDR = 0x00000010;
U0IER = 0x00000007;
// U0FCR = 0x06;
U0LCR &= 0x03;
U0FCR = 0x01;
U0RBR = 0x00;
U0THR = 0x00;
VICIntEnable = 0x00000040;
VICIntSelect = 0x00000000;
VICVectCntl0 = 0x00000026;
VICVectAddr0 = (unsigned long)uart0;
}
void uart0(void)__irq
{
// IO0SET = (1<<16+aa);
// aa++;
IO0PIN ^=(1<<19);
if(U0IIR & 0x40)
r_data = U0RBR;
VICVectAddr = 0x00;
}
void tx(unsigned char *stn)
{
do
{
while(!(U0LSR & 0x20));
U0THR = *stn++;
}
while(*stn!='\0');
}
no interrupt is generated and i want all three of interrupt.
thanzz in advance