<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Working with interrupts on LPC2129</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/17763/working-with-interrupts-on-lpc2129</link><description> I&amp;#39;m just getting started with using the Keil uV3 compiler as well as the Phillips lpc2129. The application I am working on requires both UART0 &amp;amp; 1 as well as the I2C and I&amp;#39;m wondering if anyone has some &amp;lt;sample&amp;gt; code for enabling/using interrupts handy</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/141398?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 15:14:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2e7ea418-2c37-487e-be27-c429e2095b06</guid><dc:creator>Mel Feik</dc:creator><description>&lt;p&gt;excuse my typos... I got the first one correct which was why it wasn&amp;#39;t displayed which is also why you put the spaces between the brackets (I hadn&amp;#39;t thought of that either)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/137864?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 15:00:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a8125936-58b7-4abf-8bf1-cd16b1429e1b</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;&amp;lt;/per&amp;gt; tags to retain formatting&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
That should be &amp;lt; pre &amp;gt; (to start) and &amp;lt; /pre &amp;gt; (to end) - but without the extra spaces.&lt;br /&gt;
&lt;br /&gt;
It&amp;#39;s clearly shown at the top of the form when you make a post!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/129880?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 14:02:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e7358aa1-3f34-4815-9338-638a21cbf62d</guid><dc:creator>Mel Feik</dc:creator><description>&lt;p&gt;I thought it worth mentioning that I can see the Rx Data Ready interrupt triggering when I am single stepping in the debug mode but flow does NOT jump it my ISR.&lt;br /&gt;
&lt;br /&gt;
also FYI: with regards to posting code...  use the &lt;pre&gt;&amp;lt;/per&amp;gt; tags to retain formatting
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/122442?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 13:47:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8b2957d4-1a67-4a1f-8fe3-312ab3f4fd43</guid><dc:creator>Mel Feik</dc:creator><description>&lt;p&gt;Thanks for the code, for the most part what I came up with was (about) the same.  I am not using printf and therefor have not added syscalls.c to my project.  Also adding that  file will require some work on my part as I have three different put/get-char calls (et al. putchar_uart0, putchar_uart1, putchar_i2c) but no get/put char as required in syscalls.c.&lt;br /&gt;
&lt;br /&gt;
My code is not performing correctly regarding the interrupts for uart1.  I&amp;#39;ll post the code here and also in a new thread for possible extra help.&lt;br /&gt;
&lt;br /&gt;
First of all, here is the main loop...&lt;br /&gt;
&lt;pre&gt;
	while(1)  {

		cTemp = getchar_uart1();
		if( cTemp )
			putchar_uart1( cTemp );
		cTemp = 0;

	}

&lt;/pre&gt;
&lt;br /&gt;
As you can see it is simply echoing any Rx&amp;#39;d bytes back out uart1.  This works fine when I have the uart1 interrupts disabled.  However, when I enable nothing happens that I can see, both by monitoring the output and using the uV3 debugger.  I suspect that something is amiss in my interrupt code so I&amp;#39;ll post that and maybe you can spot what I&amp;#39;m doing wrong...&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
void u1_interrupt (void) __attribute__ ((interrupt));   /* generate interrupt */

/*************************************************************************/
/**************************  interrupt for uart1  ************************/
void u1_interrupt (void)  {
	char intrpt;
	intrpt = U1IIR;   /* reset U1IIR register */
// for now just trying to echo the Rx&amp;#39;d byte back out uart1...
	intrpt = U1RBR;	// clear Rx buffer, and reset interrupt
	putchar_uart1( intrpt );

	VICVectAddr = 0;   /* acknowledge interrupt */
}/*end u1_interrupt() */



void init_uart1( void )  {
	PINSEL0 |= 0x00550000;   /* set P0.8, P0.9, P0.10 and P0.11 as TxD1, RxD1, RTS1, CTS1 */
	U1LCR = 0x83;   /* set DLAB and word size (8bits), defaults for others yield */
						 /* no parity, one stop bit, and no break */
	U1DLL = 0x61;   /* yields 9600 Baud */
	U1DLM = 0x00;   /* explicit initialization - is also the default */
	U1LCR &amp;amp;= 0x7f;   /* clear DLAB */

/* set up the interrupts */
	U1IER = 0x05;   /* enable RBR and RLS interrupts */
	VICVectAddr1 = (unsigned long) u1_interrupt;   /* set interrupt vector */
	VICVectCntl1 = 0x20 | 7;   /* use VICVectAddr1 for UART1 interrupts */
	VICIntEnable = 0x00000080;   /* enable uart1 interrupts */

}/* end init_uart1()
&lt;/pre&gt;
&lt;br /&gt;
any suggestions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/110954?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 09:24:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:356c7715-21aa-49ba-8411-4b7e46b86c0b</guid><dc:creator>Russell Bull</dc:creator><description>&lt;p&gt;The forum complained about the text being too long so I had to split it....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;&lt;br /&gt;
/*  This file is part of the uVision/ARM development tools                    */&lt;br /&gt;&lt;br /&gt;
/*  Copyright KEIL ELEKTRONIK GmbH 2002-2004                                  */&lt;br /&gt;&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;&lt;br /&gt;
/*                                                                            */&lt;br /&gt;&lt;br /&gt;
/*  SERIAL.C:  Low Level Serial Routines                                      */&lt;br /&gt;&lt;br /&gt;
/*                                                                            */&lt;br /&gt;&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
#include &amp;lt;LPC21xx.H&amp;gt;                     /* LPC21xx definitions   */&lt;br /&gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;
#include &amp;quot;serial.h&amp;quot;&lt;br /&gt;&lt;br /&gt;
#define CR     0x0D&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
extern int  sendchar (int ch);       /* in serial.c */&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
//	vars shared with the interrupt service routine&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
char tx0_buffer[1000];&lt;br /&gt;&lt;br /&gt;
volatile char *tx0_tail = tx0_buffer,*tx0_head = tx0_buffer;&lt;br /&gt;&lt;br /&gt;
volatile unsigned int tx0_count = 0;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
void uart0 (void) __attribute__ ((interrupt));    // Generate Interrupt&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
void puthexw (int hex)&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;
	puthex((hex &amp;gt;&amp;gt;12) &amp;amp; 0xf);&lt;br /&gt;&lt;br /&gt;
	puthex((hex &amp;gt;&amp;gt;8) &amp;amp; 0xf);&lt;br /&gt;&lt;br /&gt;
	puthex((hex &amp;gt;&amp;gt;4) &amp;amp; 0xf);&lt;br /&gt;&lt;br /&gt;
	puthex(hex  &amp;amp; 0xf);&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
void puthex (int hex)&lt;br /&gt;&lt;br /&gt;
{                    /* Write Hex Digit to Serial Port  */&lt;br /&gt;&lt;br /&gt;
  if (hex &amp;gt; 9) putchar(&amp;#39;A&amp;#39; + (hex - 10));&lt;br /&gt;&lt;br /&gt;
  else         putchar(&amp;#39;0&amp;#39; +  hex);&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
void putstr (char *p)&lt;br /&gt;&lt;br /&gt;
{                    /* Write string */&lt;br /&gt;&lt;br /&gt;
  while (*p) {&lt;br /&gt;&lt;br /&gt;
    putchar (*p++);&lt;br /&gt;&lt;br /&gt;
  }&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
void init_serial(enum tBaudRate baud)&lt;br /&gt;&lt;br /&gt;
{               /* Initialize Serial Interface       */&lt;br /&gt;&lt;br /&gt;
  PINSEL0 = 0x00000005;                  /* Enable RxD0 and TxD0              */&lt;br /&gt;&lt;br /&gt;
  U0LCR = 0x83;                      /* 8 bits, no Parity, 1 Stop bit     */&lt;br /&gt;&lt;br /&gt;
  switch (baud)&lt;br /&gt;&lt;br /&gt;
  	{&lt;br /&gt;&lt;br /&gt;
	case BR_1200:&lt;br /&gt;&lt;br /&gt;
		U0DLL = 0x0d;&lt;br /&gt;&lt;br /&gt;
		U0DLM = 0x03;&lt;br /&gt;&lt;br /&gt;
		break;&lt;br /&gt;&lt;br /&gt;
	case BR_2400:&lt;br /&gt;&lt;br /&gt;
		U0DLL = 0x86;&lt;br /&gt;&lt;br /&gt;
		U0DLM = 0x01;&lt;br /&gt;&lt;br /&gt;
		break;&lt;br /&gt;&lt;br /&gt;
	case BR_4800:&lt;br /&gt;&lt;br /&gt;
		U0DLL = 0xc3;&lt;br /&gt;&lt;br /&gt;
		U0DLM = 0x00;&lt;br /&gt;&lt;br /&gt;
		break;&lt;br /&gt;&lt;br /&gt;
	case BR_9600:&lt;br /&gt;&lt;br /&gt;
		U0DLL = 0x61;&lt;br /&gt;&lt;br /&gt;
		U0DLM = 0x00;&lt;br /&gt;&lt;br /&gt;
		break;&lt;br /&gt;&lt;br /&gt;
	case BR_19200:&lt;br /&gt;&lt;br /&gt;
		U0DLL = 0x30;&lt;br /&gt;&lt;br /&gt;
		U0DLM = 0x00;&lt;br /&gt;&lt;br /&gt;
		break;&lt;br /&gt;&lt;br /&gt;
	case BR_38400:&lt;br /&gt;&lt;br /&gt;
		U0DLL = 0x18;&lt;br /&gt;&lt;br /&gt;
		U0DLM = 0x00;&lt;br /&gt;&lt;br /&gt;
		break;&lt;br /&gt;&lt;br /&gt;
	}&lt;br /&gt;&lt;br /&gt;
  U0LCR = 0x03;                      /* DLAB = 0                          */&lt;br /&gt;&lt;br /&gt;
  //U0IER = 0x02;						/* enable tx interrupts */&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
  VICVectAddr1 = (unsigned long)uart0;          // set interrupt vector in 1&lt;br /&gt;&lt;br /&gt;
  VICVectCntl1 = 0x20 | 6;                    // use it for uart0 Interrupt&lt;br /&gt;&lt;br /&gt;
  VICIntEnable |= 0x00000040;                  // Enable Uart0 Interrupt&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
/* implementation of putchar (also used by printf function to output data)    */&lt;br /&gt;&lt;br /&gt;
int sendchar (int ch)                   /* Write character to Serial Port    */&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;
char tmp;&lt;br /&gt;&lt;br /&gt;
	if (ch == &amp;#39;\n&amp;#39;)&lt;br /&gt;&lt;br /&gt;
		{&lt;br /&gt;&lt;br /&gt;
		tmp = CR;&lt;br /&gt;&lt;br /&gt;
		add_char_to_tx_buff(&amp;amp;tmp,1);&lt;br /&gt;&lt;br /&gt;
		}&lt;br /&gt;&lt;br /&gt;
 	tmp = (char)ch;&lt;br /&gt;&lt;br /&gt;
	add_char_to_tx_buff(&amp;amp;tmp,1);&lt;br /&gt;&lt;br /&gt;
    return ch;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
int putchar (int ch)                    /* Write character to Serial Port    */&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;
char tmp;&lt;br /&gt;&lt;br /&gt;
//  if (ch == &amp;#39;\n&amp;#39;)  {&lt;br /&gt;&lt;br /&gt;
//    while (!(U0LSR &amp;amp; 0x20));&lt;br /&gt;&lt;br /&gt;
//    U0THR = CR;                      /* output CR */&lt;br /&gt;&lt;br /&gt;
//  }&lt;br /&gt;&lt;br /&gt;
//  while (!(U0LSR &amp;amp; 0x20));&lt;br /&gt;&lt;br /&gt;
//  return (U0THR = ch);&lt;br /&gt;&lt;br /&gt;
	if (ch == &amp;#39;\n&amp;#39;)&lt;br /&gt;&lt;br /&gt;
		{&lt;br /&gt;&lt;br /&gt;
		tmp = CR;&lt;br /&gt;&lt;br /&gt;
		add_char_to_tx_buff(&amp;amp;tmp,1);&lt;br /&gt;&lt;br /&gt;
		}&lt;br /&gt;&lt;br /&gt;
 	tmp = (char)ch;&lt;br /&gt;&lt;br /&gt;
	add_char_to_tx_buff(&amp;amp;tmp,1);&lt;br /&gt;&lt;br /&gt;
    return ch;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
int getchar (void)  {                    /* Read character from Serial Port   */&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
  while (!(U0LSR &amp;amp; 0x01));&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
  return (U0RBR);&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
// inserts chars into the tx circular buffer. enables tx ints if required&lt;br /&gt;&lt;br /&gt;
// count has the number of chars to insert&lt;br /&gt;&lt;br /&gt;
// returns 0 if not enough space in the buffer&lt;br /&gt;&lt;br /&gt;
// returns 1 if successful&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
char add_char_to_tx_buff(char *ch,int count)&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;
    if((tx0_count + count) &amp;gt;= sizeof(tx0_buffer) )&lt;br /&gt;&lt;br /&gt;
		{&lt;br /&gt;&lt;br /&gt;
		return 0;   // not enough space&lt;br /&gt;&lt;br /&gt;
		}&lt;br /&gt;&lt;br /&gt;
	VICIntEnClr = 0x00000040;                  // Disable Uart0 Interrupt&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
	if (tx0_head == tx0_tail)	//if the buffer was empty&lt;br /&gt;&lt;br /&gt;
	   {&lt;br /&gt;&lt;br /&gt;
       if (U0LSR &amp;amp; 0x20)		//if the uart is EMPTY&lt;br /&gt;&lt;br /&gt;
	   	  {&lt;br /&gt;&lt;br /&gt;
	   	  U0IER = 0x02;				// enable tx interrupts&lt;br /&gt;&lt;br /&gt;
	   	  U0THR = *ch++;			//send the first char out the UART&lt;br /&gt;&lt;br /&gt;
	   	  count--;&lt;br /&gt;&lt;br /&gt;
		  }&lt;br /&gt;&lt;br /&gt;
	   }&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
	while (count!= 0)&lt;br /&gt;&lt;br /&gt;
	   {&lt;br /&gt;&lt;br /&gt;
	   *tx0_head++ = *ch++; 		//insert the char into the buffer&lt;br /&gt;&lt;br /&gt;
	   if (tx0_head &amp;gt;= (tx0_buffer + sizeof(tx0_buffer)) )&lt;br /&gt;&lt;br /&gt;
	   	{&lt;br /&gt;&lt;br /&gt;
	   	tx0_head = tx0_buffer; 		//wrap index if req&amp;#39;d&lt;br /&gt;&lt;br /&gt;
		}&lt;br /&gt;&lt;br /&gt;
	   tx0_count++;&lt;br /&gt;&lt;br /&gt;
	   count--;&lt;br /&gt;&lt;br /&gt;
       }&lt;br /&gt;&lt;br /&gt;
	VICIntEnable = 0x00000040;                  // Enable Uart0 Interrupt&lt;br /&gt;&lt;br /&gt;
    return 1;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
//	uart0 isr routine&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
void uart0(void)&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;
if (U0LSR &amp;amp; 0x20)//if tx interrupt&lt;br /&gt;&lt;br /&gt;
	{&lt;br /&gt;&lt;br /&gt;
 	if (tx0_head == tx0_tail) 	//buffer empty?&lt;br /&gt;&lt;br /&gt;
 		{&lt;br /&gt;&lt;br /&gt;
		U0IER &amp;amp;= ~0x02;	//disable the tx interrupt&lt;br /&gt;&lt;br /&gt;
		}&lt;br /&gt;&lt;br /&gt;
 	else		  	 		   //we have something to send&lt;br /&gt;&lt;br /&gt;
 		{&lt;br /&gt;&lt;br /&gt;
		tx0_count--;&lt;br /&gt;&lt;br /&gt;
		U0THR = *tx0_tail++;&lt;br /&gt;&lt;br /&gt;
		if (tx0_tail &amp;gt;= (tx0_buffer + sizeof(tx0_buffer)) )&lt;br /&gt;&lt;br /&gt;
			{&lt;br /&gt;&lt;br /&gt;
			tx0_tail = tx0_buffer;		//wrap tail buffer&lt;br /&gt;&lt;br /&gt;
			}&lt;br /&gt;&lt;br /&gt;
		}&lt;br /&gt;&lt;br /&gt;
	}&lt;br /&gt;&lt;br /&gt;
	VICVectAddr = 0;                            // Acknowledge Interrupt&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
// end of file&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/96439?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 09:23:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7dd3cb89-3c41-4d98-b6f6-a020d08dd20c</guid><dc:creator>Russell Bull</dc:creator><description>&lt;p&gt;Here is my code for interrupt driven comms. The formatting may have been screwed up by me pasting the code! Be sure to add the file syscalls.c to your project for printf to work. The code hasn&amp;#39;t been extensively tested but the techniques used are common.&lt;br /&gt;&lt;br /&gt;
To modify the code for the other serial port, change the references from uart0 to uart1 and read the philips doc on the VIC to change the interrupt stuff to use uart1. The interrupts are a little more sophisticated than what you&amp;#39;d find on a 8051. What got me stuck for a little while was putting this line at the end of the service routine:&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
VICVectAddr=0; // Acknowledge Interrupt&lt;br /&gt;&lt;br /&gt;
Without it you won&amp;#39;t service another interrupt!&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
 Hopefully this code will answer all your questions. If not, come back to the forum!&lt;br /&gt;&lt;br /&gt;
Don&amp;#39;t ask me about I2C stuff as I haven&amp;#39;t tried that yet!&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
Have fun!&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
// serial.h&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
enum tBaudRate {BR_1200,BR_2400,BR_4800,BR_9600,BR_19200,BR_38400};&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
extern void init_serial (enum tBaudRate baud);  /* Initialize Serial Interface     */&lt;br /&gt;&lt;br /&gt;
extern int  putchar (int ch);              /* Write character to Serial Port  */&lt;br /&gt;&lt;br /&gt;
extern int  getchar (void);                /* Read character from Serial Port */&lt;br /&gt;&lt;br /&gt;
void outstr(char *str,int length);			//outputs a string via interrupt&lt;br /&gt;&lt;br /&gt;
char add_char_to_tx_buff(char *ch,int count);&lt;br /&gt;&lt;br /&gt;
void puthexw (int hex);&lt;br /&gt;&lt;br /&gt;
void puthex (int hex);&lt;br /&gt;&lt;br /&gt;
void putstr (char *p);&lt;br /&gt;&lt;br /&gt;
// end of file&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
// main code.&lt;br /&gt;&lt;br /&gt;
//&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
#include &amp;lt;LPC21xx.H&amp;gt;                        /* LPC21xx definitions */&lt;br /&gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;
#include &amp;quot;serial.h&amp;quot;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
int main(void)&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
char j;&lt;br /&gt;&lt;br /&gt;
init_serial(BR_19200);&lt;br /&gt;&lt;br /&gt;
  for (j =0;j &amp;lt; 10;j++)&lt;br /&gt;&lt;br /&gt;
  	{&lt;br /&gt;&lt;br /&gt;
	printf(&amp;quot;testing %04d \n&amp;quot;,j);&lt;br /&gt;&lt;br /&gt;
	}&lt;br /&gt;&lt;br /&gt;
while(1);&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
//end of file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/86848?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2004 01:28:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4d8a05be-2b54-4dc1-830f-c4eeaecd1a42</guid><dc:creator>Russell Bull</dc:creator><description>&lt;p&gt;I&amp;#39;ve already been through that phase. I&amp;#39;ll try to post some code later (i&amp;#39;m at the office at the moment) that I wrote which is circular buffer interrupt driven serial comms. I suggest you look at the blinky_irq code carefully and read the philips doc in the VIC to understand how the interrupt controller works. Once you&amp;#39;ve done that the whole thing is fairly simple.&lt;br /&gt;
&lt;br /&gt;
Each device has an interrupt number, that has to be set for an interrupt vector you choose (this sets the priority in regards to the other interrupts). Load the vector register with the address of your interrupt service routine, enable the interrupt  and you&amp;#39;re away. At the end of the interrupt service routine you must put a 0 in the VIC service register to ack the interrupt. You will see this in the blinky_irq code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Working with interrupts on LPC2129</title><link>https://community.arm.com/thread/42452?ContentTypeID=1</link><pubDate>Mon, 05 Jul 2004 11:38:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bb8a77a7-3018-4161-b05e-a802e9637be8</guid><dc:creator>Mel Feik</dc:creator><description>&lt;p&gt;I should have mentioned that I&amp;#39;ve gone through both the blinky and blinky_irq code examples provided by Keil but found them a bit lacking in getting me started writing my own interrupt driven drivers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>