<?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>LPC MicrocontrollersのトピックRe: How to Read multiple ADC values on LPC11U68</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1420929#M48072</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/83796"&gt;@daisukefukuda_n&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that you are doing well!&lt;/P&gt;
&lt;P&gt;So the problem only appears with the order of which channel do you read ? If&lt;SPAN&gt;&amp;nbsp;ReadValue(0) is called before ReadValue(1) the code does not get stuck?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here I got initial recommendations&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Try to force a SW triggered conversion (calling&amp;nbsp; again Chip_ADC_StartSequencer () ) , and also&amp;nbsp; check if this conversion mode is actually enabled at register level.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I will recommend to test the ADCA sequencer&amp;nbsp; in the &lt;STRONG&gt;&lt;EM&gt;periph_dma_adc&lt;/EM&gt;&lt;/STRONG&gt; LPCopen example.I think that we could isolate the issue only testing with once SEQ, Could you adapt the example to work with SEQB and verify in your HW? Also this example works through interrupts.&lt;/P&gt;
&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2022 05:20:08 GMT</pubDate>
    <dc:creator>diego_charles</dc:creator>
    <dc:date>2022-03-01T05:20:08Z</dc:date>
    <item>
      <title>How to Read multiple ADC values on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1420483#M48059</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;This is Daisuke FUKUDA with NEXTY Electronics Japan. Thank you for your support.&lt;/P&gt;&lt;P&gt;I've been developing a evaluation board for our client with LPC11U68. Now I'm implementing to read ADC values. The key point of this function is the followint.&lt;/P&gt;&lt;P&gt;1. I'd like to read value in PIO0_14 and PIO0_12 with a software trigger when each function is called.&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;a = ReadValue(0); // -&amp;gt; Read in PIO0_14&lt;/P&gt;&lt;P&gt;b = ReadValue(1); // -&amp;gt; Read in PIO0_12&lt;/P&gt;&lt;P&gt;2. I'd like to use only ADC_SEQB_IDX because ADC_SEQA has been already used for the other function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the read function cannot go out from the infinite loop as below when ReadValue(1) is called after ReadValue(0).&lt;/P&gt;&lt;P&gt;-&amp;nbsp;while(!ADC_DR_DONE(Chip_ADC_GetDataReg(LPC_ADC, tblADCNum[nADC])));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part of codes is below. If you find something for me to check, can you let me know?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define ADC_CLK_RATE 10000&lt;BR /&gt;#define ADC_SEQIDX ADC_SEQB_IDX&lt;BR /&gt;#define ADC_CH 8 // PIO0_12_ADC&lt;/P&gt;&lt;P&gt;unsigned int tblADCNum[MAX_MY_ADC] = {&lt;BR /&gt;6, // MY_ADC_1, // ADC 6 (PIO0_14)&lt;BR /&gt;8 // MY_ADC_2, // ADC 8 (PIO0_12)&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;void Init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 14, (IOCON_FUNC2 | IOCON_MODE_INACT | IOCON_ADMODE_EN));&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 14, (IOCON_FUNC2 | IOCON_MODE_INACT | IOCON_ADMODE_EN));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void Init_myADC(void)&lt;BR /&gt;{&lt;BR /&gt;// eMYADC_NUM i;&lt;/P&gt;&lt;P&gt;/* Setup ADC for 12-bit mode and normal power */&lt;BR /&gt;Chip_ADC_Init(LPC_ADC, 0);&lt;/P&gt;&lt;P&gt;/* Need to do a calibration after initialization and trim */&lt;BR /&gt;Chip_ADC_StartCalibration(LPC_ADC);&lt;BR /&gt;while (!(Chip_ADC_IsCalibrationDone(LPC_ADC))) {}&lt;/P&gt;&lt;P&gt;Chip_ADC_SetClockRate(LPC_ADC, ADC_CLK_RATE);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;unsigned int GetValue_myADC(eMYADC_NUM nADC)&lt;BR /&gt;{&lt;BR /&gt;unsigned int val;&lt;/P&gt;&lt;P&gt;uint32_t rawSample;&lt;/P&gt;&lt;P&gt;Chip_ADC_SetupSequencer(LPC_ADC, ADC_SEQIDX,&lt;BR /&gt;(ADC_SEQ_CTRL_CHANSEL(tblADCNum[nADC]) | ADC_SEQ_CTRL_MODE_EOS));&lt;BR /&gt;Chip_ADC_EnableSequencer(LPC_ADC, ADC_SEQIDX);&lt;/P&gt;&lt;P&gt;while(!ADC_DR_DONE(Chip_ADC_GetDataReg(LPC_ADC, tblADCNum[nADC])));&lt;/P&gt;&lt;P&gt;rawSample = Chip_ADC_GetDataReg(LPC_ADC, tblADCNum[nADC]);&lt;/P&gt;&lt;P&gt;val = ADC_DR_RESULT(rawSample);&lt;/P&gt;&lt;P&gt;Chip_ADC_DisableSequencer(LPC_ADC, ADC_SEQIDX);&lt;/P&gt;&lt;P&gt;Chip_ADC_ClearSequencerBits(LPC_ADC, ADC_SEQIDX,&lt;BR /&gt;(ADC_SEQ_CTRL_CHANSEL(tblADCNum[nADC]) | ADC_SEQ_CTRL_MODE_EOS));&lt;/P&gt;&lt;P&gt;return val;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Daisuke&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 09:53:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1420483#M48059</guid>
      <dc:creator>daisukefukuda_n</dc:creator>
      <dc:date>2022-02-28T09:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read multiple ADC values on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1420929#M48072</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/83796"&gt;@daisukefukuda_n&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that you are doing well!&lt;/P&gt;
&lt;P&gt;So the problem only appears with the order of which channel do you read ? If&lt;SPAN&gt;&amp;nbsp;ReadValue(0) is called before ReadValue(1) the code does not get stuck?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here I got initial recommendations&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Try to force a SW triggered conversion (calling&amp;nbsp; again Chip_ADC_StartSequencer () ) , and also&amp;nbsp; check if this conversion mode is actually enabled at register level.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I will recommend to test the ADCA sequencer&amp;nbsp; in the &lt;STRONG&gt;&lt;EM&gt;periph_dma_adc&lt;/EM&gt;&lt;/STRONG&gt; LPCopen example.I think that we could isolate the issue only testing with once SEQ, Could you adapt the example to work with SEQB and verify in your HW? Also this example works through interrupts.&lt;/P&gt;
&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 05:20:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1420929#M48072</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2022-03-01T05:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read multiple ADC values on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1421010#M48077</link>
      <description>&lt;P&gt;Hi Diego,&lt;/P&gt;&lt;P&gt;This is Daisuke FUKUDA with NEXTY Electronics JAPAN. Thank you for your prompt reply.&lt;/P&gt;&lt;P&gt;I'm going to try based on your advice. I'll get back to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;FUKUDA&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 07:15:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1421010#M48077</guid>
      <dc:creator>daisukefukuda_n</dc:creator>
      <dc:date>2022-03-01T07:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read multiple ADC values on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1426557#M48178</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/83796"&gt;@daisukefukuda_n&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to update&amp;nbsp; if you are still facing problems, or any further questions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 05:04:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-Read-multiple-ADC-values-on-LPC11U68/m-p/1426557#M48178</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2022-03-11T05:04:36Z</dc:date>
    </item>
  </channel>
</rss>

