<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Non working ADC on LPC824 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565189#M17031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by remcopoelstra on Thu Mar 12 02:58:14 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to get the ADC on the LPC824. I currently apply either 0V or 3V3 on channel 0, but as a result I always get back a value in the range 0x20-0x30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enabled the channel 0 pin in SWM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've enabled power and clock to the ADC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Run the calibration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Setup a clock of 500kHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enabled a burst sequence.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since my source has quite a high impedance (1kOhm), I see the ripple of the ADC on the signal and it's 20kHz, as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the debugger I see that the values in the data registers get updated all the time, but the range is always 0x20-0x30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked VREFP and VREFN and they are 3V3 and 0V.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Condensed code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
Chip_SWM_EnableFixedPin(SWM_FIXED_ADC0);
Chip_ADC_Init(LPC_ADC,0); //This will enable power and clock
Chip_ADC_StartCalibration(LPC_ADC);
while(!Chip_ADC_IsCalibrationDone(LPC_ADC));
Chip_ADC_SetClockRate(LPC_ADC,500000); //500kHz
Chip_ADC_SetupSequencer(LPC_ADC,ADC_SEQA_IDX,
ADC_SEQ_CTRL_CHANSEL(0)|
ADC_SEQ_CTRL_MODE_EOS);
Chip_ADC_EnableSequencer(LPC_ADC,ADC_SEQA_IDX);
Chip_ADC_StartBurstSequencer(LPC_ADC,ADC_SEQA_IDX);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong? Did I miss something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remco Poelstra&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:04:25 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:04:25Z</dc:date>
    <item>
      <title>Non working ADC on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565189#M17031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by remcopoelstra on Thu Mar 12 02:58:14 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to get the ADC on the LPC824. I currently apply either 0V or 3V3 on channel 0, but as a result I always get back a value in the range 0x20-0x30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enabled the channel 0 pin in SWM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've enabled power and clock to the ADC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Run the calibration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Setup a clock of 500kHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enabled a burst sequence.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since my source has quite a high impedance (1kOhm), I see the ripple of the ADC on the signal and it's 20kHz, as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the debugger I see that the values in the data registers get updated all the time, but the range is always 0x20-0x30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked VREFP and VREFN and they are 3V3 and 0V.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Condensed code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
Chip_SWM_EnableFixedPin(SWM_FIXED_ADC0);
Chip_ADC_Init(LPC_ADC,0); //This will enable power and clock
Chip_ADC_StartCalibration(LPC_ADC);
while(!Chip_ADC_IsCalibrationDone(LPC_ADC));
Chip_ADC_SetClockRate(LPC_ADC,500000); //500kHz
Chip_ADC_SetupSequencer(LPC_ADC,ADC_SEQA_IDX,
ADC_SEQ_CTRL_CHANSEL(0)|
ADC_SEQ_CTRL_MODE_EOS);
Chip_ADC_EnableSequencer(LPC_ADC,ADC_SEQA_IDX);
Chip_ADC_StartBurstSequencer(LPC_ADC,ADC_SEQA_IDX);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong? Did I miss something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remco Poelstra&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:04:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565189#M17031</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Non working ADC on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565190#M17032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Thu Mar 12 05:08:19 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to enable the clock for SWM first (you can disable it after setup is complete). Maybe some other clocks, too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:04:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565190#M17032</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Non working ADC on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565191#M17033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by remcopoelstra on Thu Mar 12 06:13:46 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. Seems my code was a bit too condensed. I do enable clocks to the SWM and in the debugger all registers have the values they should have. Since the analog waveform contains noise from the ADC process I believe the pin setup is correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remco Poelstra&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:04:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Non-working-ADC-on-LPC824/m-p/565191#M17033</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:04:26Z</dc:date>
    </item>
  </channel>
</rss>

