<?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>read voltage on pin mcb2300</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/37934/read-voltage-on-pin-mcb2300</link><description> 
Dear All, 

 
I have a mcb2300 board with LPC2378. I want to read the voltage
with Test Multimeter from PIN0.0. I read from Document that this pin
corresponds to the PIN 66 on the board. So I set pin 66 with this
code: 

 
PINSEL0 |= 0x00000000; 

</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: read voltage on pin mcb2300</title><link>https://community.arm.com/thread/89203?ContentTypeID=1</link><pubDate>Tue, 29 Jul 2008 06:57:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:992a4305-600e-4ac2-aaab-e96c58a5483d</guid><dc:creator>miky miky</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks a lot&lt;/p&gt;

&lt;p&gt;
Miky&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: read voltage on pin mcb2300</title><link>https://community.arm.com/thread/52132?ContentTypeID=1</link><pubDate>Tue, 29 Jul 2008 06:51:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9234eba7-64d2-4dcb-bbb9-8c3eda206cc3</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
I guess you are quite new with C and&amp;acirc;&amp;circ;&amp;uml; C++.&lt;/p&gt;

&lt;pre&gt;
PINSEL0 |= 0x00000000
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
This is a null operation - you are basically adding 0 to the
register, so you don&amp;#39;t change anything.&lt;/p&gt;

&lt;p&gt;
Another thing: PINSEL0 controls the function of the first 16 port
pins of PORT0. It does not change the state of any pin, i.e. setting
it high or low.&lt;/p&gt;

&lt;p&gt;
To change the state of a pin, you should instead use IO0SET or -
if you have enabled fast GPIO - FIO0SET.&lt;/p&gt;

&lt;p&gt;
But first you have to set the pin as an output, with either IO0DIR
or FIO0DIR as:&lt;/p&gt;

&lt;pre&gt;
IO0DIR |= 1u &amp;lt;&amp;lt; 0; // set P0.0 as output
IO0DIR |= 1u &amp;lt;&amp;lt; 1; // set P0.1 as output
...
IO0DIR |= 1u &amp;lt;&amp;lt; 31; // set P0.31 as output

IO0DIR &amp;amp;= ~(1u &amp;lt;&amp;lt; 0); // set P0.0 as input
IO0DIR &amp;amp;= ~(1u &amp;lt;&amp;lt; 1); // set P0.1 as input
...
IO0DIR &amp;amp;= ~(1u &amp;lt;&amp;lt; 31); // set P0.31 as input
&lt;/pre&gt;

&lt;p&gt;
Then you can control the bits on the port:&lt;/p&gt;

&lt;pre&gt;
IO0SET = 1u &amp;lt;&amp;lt; 0; // set P0.0.
IO0SET = 1u &amp;lt;&amp;lt; 1; // set P0.1.
...
IO0SET = 1u &amp;lt;&amp;lt; 31; // set P0.31.
&lt;/pre&gt;
&lt;pre&gt;
&lt;br /&gt;
IO0CLR = 1u &amp;lt;&amp;lt; 0; // clear P0.0&lt;br /&gt;
IO0CLR = 1u &amp;lt;&amp;lt; 1; // clear P0.1&lt;br /&gt;
...&lt;br /&gt;
IO0CLR = 1u &amp;lt;&amp;lt; 31; // clear P0.31&lt;br /&gt;
&lt;/pre&gt;

&lt;p&gt;
Take a look at the example programs. There are documented code
that plays with the LED on the board.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>