Hi...!! I have one problem related to keil setting. This is my code given below. which is working fine. which below keil setting.
keil > go in "flash" option > "config flash tool" > "Target" > tick "IROM1" (for start =0x0 to size =0x80000)
but when I do change in "IROM" (start = 0x2000 to size = 0x80000), At the time of interrupt, program is not generate any vector address table at 0x18,so I can't able to jump in to IRQ routine.
IS THIS ANY SETTING HAS TO BE DONE WHEN I WRITE 2000 IN IROM ??
#include <LPC214x.H> /* LPC21xx definitions */ #include "Serial.h" #define CR 0x0D extern char ch; void uart0_getkey (void) __irq // This is the func which contr need to call when an interrupt occurs { VICVectAddr=0x00; b=1; ch = U0RBR; } //---------------------------------------------------------------------------// //------------------- Function for Initial UART0 ----------------------------// //---------------------------------------------------------------------------// void uart0_init() { /* initialize the serial interface */ PINSEL0 = 0x00000005; /* Enable RxD0 and TxD0 */ U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ U0DLL = 0xc2; /* 9600 Baud Rate @ 30MHz VPB Clock */ U0LCR = 0x03; /* DLAB = 0 */ VICIntSelect= 0x00; VICVectCntl0 = 0x20 | 6; VICVectAddr0 = (unsigned long)uart0_getkey; U0IER = 0x01; // enabled Receive interrupt VICIntEnable = 0x0040; temp = U0RBR; } //------------------------------------------------------------------------------------------------// //---------------------------- Function for send character 1 time via UART0-----------------------// //------------------------------------------------------------------------------------------------// void uart0_putc(char c) { while(!(U0LSR & 0x20)); // Wait until UART0 ready to send character U0THR = c; // Send character } //-----------------------------------------------------------------------------// //--------------- Function for send string via UART0---------------------------// //-----------------------------------------------------------------------------// void uart0_puts(char *p) { while(*p) // Point to character { uart0_putc(*p++); // Send character then point to next character } }
My main file
******************************************************************************************* #include <LPC214x.H> /* LPC21xx definitions */ #include <stdio.h> /* prototype declarations for I/O functions */ #include "Serial.h" int b=0; int temp; char ch = '\0'; int main (void) { /* execution starts here */ uart0_init(); // Initialize UART0 while (1) { /* An embedded program does not stop */ if(b) { uart0_putc(ch); b=0; } } }
My serial.h file
#ifndef _serial_ #define _serial_ void uart0_getkey(void) __irq; void uart0_init (void); void uart0_putc (char); void uart0_puts (char *); void init(void); extern int b; extern int temp; #endif