<?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>ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/33760/adc-converter-5-v-power-supply-with-lpc2368</link><description> 
i need help i wrote dies small code for a test conversion of my
power supply (5V) i try to see it on debugger Mode in AD convert
0; 

 
this function is for the conversion : 

 
AD0CR |=0x00000000;// AD convertion start 

 
while(AD0DR &amp;amp; 0x80000000</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/140774?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 12:18:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:60518d60-7743-41fd-99ef-cebfa38d50ae</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
The compiler - and the processor - does not agree with you that
the two statements would mean the same.&lt;/p&gt;

&lt;pre&gt;
val = 0x12345678;

a = (val &amp;amp; 0x3ff) &amp;gt;&amp;gt; 6;
b = (val &amp;gt;&amp;gt; 6) &amp;amp; 0xff;
&lt;/pre&gt;

&lt;p&gt;
The end result?&lt;/p&gt;

&lt;p&gt;
a will extract 0x278 and shift 6 steps right. End result 9.&lt;/p&gt;

&lt;p&gt;
b will shift 6 steps right which gives 0x48d159. Then mask and get
0x159.&lt;/p&gt;

&lt;p&gt;
Only one of these two expressions will correctly pick up the 10
bits of ADC measurement from the data register and make the
measurement available as a number between 0 and 1023.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/131994?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 12:02:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0aba8376-f53e-43ab-85fb-79834a56e834</guid><dc:creator>steve Tougnia</dc:creator><description>&lt;p&gt;&lt;p&gt;
i forgot with ARM; LPC23XX&lt;/p&gt;

&lt;p&gt;
thx&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/131439?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 11:58:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:26fb0ecf-4fae-429d-9a0e-9953a05edf81</guid><dc:creator>steve Tougnia</dc:creator><description>&lt;p&gt;&lt;p&gt;
o.k thkx in this case it mean the same&lt;/p&gt;

&lt;p&gt;
because&lt;br /&gt;
(AD0DR&amp;amp;0x03FF) choose the right channel(in my case ch 0)....
&amp;gt;&amp;gt; shiftihng it to right 6 place of 10 Bit value;&lt;/p&gt;

&lt;p&gt;
or AD0DR&amp;gt;&amp;gt;6; first shifting and choose the right channel
(AD0DR&amp;gt;&amp;gt;6)&amp;amp;0x03FF&lt;/p&gt;

&lt;p&gt;
can you please have a &lt;b&gt;complet code&lt;/b&gt; For an &lt;b&gt;AD- Convert
(&lt;/b&gt;ad_init(); &lt;b&gt;ad_read()&lt;/b&gt;; &lt;b&gt;the main function&lt;/b&gt; to managed
and view the result of the convertion) it will be so helpfull&lt;/p&gt;

&lt;p&gt;
Thx Webmaster&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/128717?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 11:17:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:30567f73-2d4b-4cec-ad7e-236291b46073</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
If you have no other tools available to tell you the difference
between the two statements, you could use a pen and paper.&lt;/p&gt;

&lt;p&gt;
This really is &lt;b&gt;very&lt;/b&gt; basic programming skills. That&amp;#39;s like
talking about math and not understanding the difference between
(2+3)*4 or 2+(3*4).&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/117644?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 10:54:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:57c19c8d-9c73-47c3-aba9-fb846decece0</guid><dc:creator>steve Tougnia</dc:creator><description>&lt;p&gt;&lt;p&gt;
my intention is to take the result of the conversion and give it
out !&lt;/p&gt;

&lt;p&gt;
what is the difference between :return(AD0DR&amp;amp;0x03FF)&amp;gt;&amp;gt;6;
and return(AD0DR&amp;gt;&amp;gt;6)&amp;amp;0x03FF; ??&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/107897?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 04:23:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fb4d1908-029e-4051-b57e-3b8ae67c029a</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
It really was your intention???&lt;/p&gt;

&lt;p&gt;
Are you aware of the difference between the following two
constructs?&lt;/p&gt;

&lt;pre&gt;
return (AD0DR&amp;amp;0x03FF)&amp;gt;&amp;gt;6;
&lt;/pre&gt;
&lt;pre&gt;
return (AD0DR&amp;gt;&amp;gt;6)&amp;amp;0x03FF;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/82140?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2014 03:50:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:01e07ad4-122b-4255-b51f-5d953b8dd7f1</guid><dc:creator>steve Tougnia</dc:creator><description>&lt;p&gt;&lt;p&gt;
yes it was my Intention but after the convertion is done how can i
see the result of my conversion&lt;br /&gt;
or the (1024 for the 5v) in my virtual window&lt;/p&gt;

&lt;p&gt;
i wrote this but didn&amp;acute;t function:&lt;/p&gt;

&lt;p&gt;
in my main funtion&lt;br /&gt;
while(1){&lt;/p&gt;

&lt;p&gt;
AD0DR=adc_read(); // put the result into chnnel 0 ADoDr;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CONVERTER 5 v  power supply with LPC2368</title><link>https://community.arm.com/thread/68894?ContentTypeID=1</link><pubDate>Tue, 23 Sep 2014 00:27:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6a6a0dcd-8210-4127-8e61-139e435d9193</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Interesting code you have:&lt;/p&gt;

&lt;pre&gt;
return ((AD0DR&amp;amp;0x03FF)&amp;gt;&amp;gt;6);
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
The ADC is 10 bit wide. Which is represented by 0x3FF.&lt;/p&gt;

&lt;p&gt;
You extract 10 bits from AD0DR. Then you directly shift 6 ticks
right. Was that really your intention?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>