<?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>explanation and pin configuration for code in lpc2148</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/34388/explanation-and-pin-configuration-for-code-in-lpc2148</link><description> 
int x;
 PINSEL0 = (PINSEL0 &amp;amp; 0x3FFF3FF0) | 0x00000005; // Configure pins for touch screen
 PINSEL1 = (PINSEL1 &amp;amp; 0xC3FFFFFF) | 0x10000000;
 IO0DIR = (IO0DIR &amp;amp; 0xDFFF7F7F) | 0x00008080;

 IO0SET = IO0SET | 0x00000080; // Set pin to &amp;#39;1&amp;#39;
 IO0CLR = IO0CLR</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: explanation and pin configuration for code in lpc2148</title><link>https://community.arm.com/thread/109153?ContentTypeID=1</link><pubDate>Sat, 22 Apr 2017 08:40:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b3bfd5ff-53af-4f67-b4d9-1abdc241849d</guid><dc:creator>A Coder</dc:creator><description>&lt;p&gt;&lt;p&gt;
Whats wrong with your reference manual?&lt;/p&gt;

&lt;p&gt;
The code you &amp;#39;found&amp;#39; is very ugly. Maybe if you knew more about
what you&amp;#39;re after then you&amp;#39;d recognise something better.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: explanation and pin configuration for code in lpc2148</title><link>https://community.arm.com/thread/83607?ContentTypeID=1</link><pubDate>Sat, 22 Apr 2017 07:13:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6fb6af9d-e379-4639-b95f-79f77c0ebf23</guid><dc:creator>Jayapriya A</dc:creator><description>&lt;p&gt;&lt;pre&gt;
#include&amp;lt;lpc214x.h&amp;gt; // Header file for Phillips LPC2148 controller
#include&amp;lt;stdio.h&amp;gt;
#define CCLK 30
#define PCLK 10
#include&amp;lt;uart.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;
int x;
int y;
int xcoordinate(void);
int ycoordinate(void);

void delayms(unsigned int ms);
#define DAC_BIAS   0x00010000
int main(void)
{
        xcoordinate();

        ycoordinate();

}
void delayms(unsigned int ms)
{

        T0TCR = 0x02;
        T0TCR = 0x01;
        while( T0TC &amp;lt; ms);
        T0TCR = 0x00;
}
int xcoordinate(void)
{
 int x;
 PINSEL0 = (PINSEL0 &amp;amp; 0x3FFF3FF0) | 0x00000005; // Configure pins for touch screen
 PINSEL1 = (PINSEL1 &amp;amp; 0xC3FFFFFF) | 0x10000000;
 IO0DIR =  (IO0DIR &amp;amp;  0xDFFF7F7F) | 0x00008080;

 IO0SET = IO0SET | 0x00000080;     // Set pin to &amp;#39;1&amp;#39;
 IO0CLR = IO0CLR | 0x00008000;    // Set pin to &amp;#39;0&amp;#39;

 AD0CR = ( AD0CR &amp;amp; 0xFFD00000 ) | 0x00200208 ;  // Start the ADC

 while(1)
 {
   delayms(10);
   AD0CR = ( AD0CR &amp;amp; 0xF8FFFFFF ) | 0x01000000 ;

 xchkadc:

   x = AD0DR3 &amp;amp; 0x80000000 ;

   if(x == 0x80000000)  // Check if A-D conversion is complete
    {

      x = 0x00000000;
      x = AD0DR3 &amp;amp; 0x0000FFC0;
      x = x &amp;gt;&amp;gt; 6;
      x = x &amp;amp; 0x000003FF;
      if(x &amp;lt;= 10)
      {
        goto xexit;
      }

      AD0CR = AD0CR &amp;amp; 0xF8FFFFFF;
      return x;     // return the value of touch in x direction

    }

   goto xchkadc;

  xexit:
  AD0CR = AD0CR &amp;amp; 0xF8FFFFFF;
  }
  return 0;
}

int ycoordinate(void)
{
 int y;

 PINSEL0 = (PINSEL0 &amp;amp; 0x3FFF3FF0) | 0xC0000005;    // Configure pins for touch screen
 PINSEL1 = (PINSEL1 &amp;amp; 0xC3FFFFFF) | 0x00000000;

 IO0DIR = (IO0DIR &amp;amp; 0x9FFFFF7F) | 0x60000000;

 IO0SET = IO0SET | 0x40000000;    //// Set pin to &amp;#39;1&amp;#39;
 IO0CLR = IO0CLR | 0x20000000;    //// Set pin to &amp;#39;0&amp;#39;

 AD1CR = (AD1CR &amp;amp; 0xF0D00000) | 0x00200220 ;    //// Start the ADC

 while(1)
 {

  delayms(10);
  AD1CR = ( AD1CR &amp;amp; 0xF8FFFFFF ) | 0x01000000 ;

   ychkadc:

   y = AD1DR5 &amp;amp; 0x80000000 ;

   if(y == 0x80000000)    // Check if A-D conversion is complete
    {

      y = 0x00000000;
      y = AD1DR5 &amp;amp; 0x0000FFC0;
      y = y &amp;gt;&amp;gt; 6;
      y = y &amp;amp; 0x000003FF;
      if(y &amp;lt;= 10)
      {
        goto yexit1;
      }

      AD1CR = AD1CR &amp;amp; 0xF8FFFFFF;
      return y;            // return the value of touch in y direction

    }

   goto ychkadc;

   yexit1:

    AD1CR = AD1CR &amp;amp; 0xF8FFFFFF;
  }

 return 0;
}
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
this is a code for touch screen interface which I got from net...I
don&amp;#39;t understand which pins I should connect on my arm7 board to get
the touch coordinates in lcd&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: explanation and pin configuration for code in lpc2148</title><link>https://community.arm.com/thread/69982?ContentTypeID=1</link><pubDate>Sat, 22 Apr 2017 07:10:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7aef6f47-a4b6-47de-bad0-09fb2397aaf0</guid><dc:creator>A Coder</dc:creator><description>&lt;p&gt;&lt;p&gt;
Is there a page missing from your reference manual pdf file?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>