<?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>Model-Based Design Toolbox (MBDT)中的主题 Multiple ADC channel with SW trigger</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Multiple-ADC-channel-with-SW-trigger/m-p/1341373#M6516</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using S32k146, and I want to use 15 pins as an ADC.(most of them to monitor the temperature data)&lt;/P&gt;&lt;P&gt;ADC0: 10channels, ADC1: 5channels&lt;/P&gt;&lt;P&gt;Here I know that I can use HW or SW trigger in the ADC.&lt;/P&gt;&lt;P&gt;But according to the S32K reference manual, if I use HW trigger, I can only use a maximum of 8 channels from each ADC module.&lt;/P&gt;&lt;P&gt;So I want to use the SW trigger to overcome this issue. But here, only the SC1A register is available for SW trigger.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I want to know how to trigger 15 ADC channels by this single SC1A register.&lt;/P&gt;&lt;P&gt;Can anyone provide an example for this?&lt;/P&gt;&lt;P&gt;2. Is there any other way to use 10&amp;nbsp; ADC channels in the HW trigger mode?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/72088"&gt;@mariuslucianand&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/103940"&gt;@adriantudor&lt;/a&gt;&amp;nbsp; Can you help me with this?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 03:08:53 GMT</pubDate>
    <dc:creator>p_a_u_darshana</dc:creator>
    <dc:date>2021-10-12T03:08:53Z</dc:date>
    <item>
      <title>Multiple ADC channel with SW trigger</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Multiple-ADC-channel-with-SW-trigger/m-p/1341373#M6516</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using S32k146, and I want to use 15 pins as an ADC.(most of them to monitor the temperature data)&lt;/P&gt;&lt;P&gt;ADC0: 10channels, ADC1: 5channels&lt;/P&gt;&lt;P&gt;Here I know that I can use HW or SW trigger in the ADC.&lt;/P&gt;&lt;P&gt;But according to the S32K reference manual, if I use HW trigger, I can only use a maximum of 8 channels from each ADC module.&lt;/P&gt;&lt;P&gt;So I want to use the SW trigger to overcome this issue. But here, only the SC1A register is available for SW trigger.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I want to know how to trigger 15 ADC channels by this single SC1A register.&lt;/P&gt;&lt;P&gt;Can anyone provide an example for this?&lt;/P&gt;&lt;P&gt;2. Is there any other way to use 10&amp;nbsp; ADC channels in the HW trigger mode?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/72088"&gt;@mariuslucianand&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/103940"&gt;@adriantudor&lt;/a&gt;&amp;nbsp; Can you help me with this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 03:08:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Multiple-ADC-channel-with-SW-trigger/m-p/1341373#M6516</guid>
      <dc:creator>p_a_u_darshana</dc:creator>
      <dc:date>2021-10-12T03:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple ADC channel with SW trigger</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Multiple-ADC-channel-with-SW-trigger/m-p/1411236#M6979</link>
      <description>&lt;P&gt;Hello, I hope it is still useful to you. Here you have the most relevant part of code:&lt;/P&gt;&lt;PRE&gt;typedef struct {&lt;BR /&gt;uint8_t chan;&lt;BR /&gt;uint8_t mod;&lt;BR /&gt;} TCA_ADCCFG_TYPE;&lt;BR /&gt;typedef struct {&lt;BR /&gt;TCA_ADCCFG_TYPE var[TCA_NUMBER_OF_SWITCHES];&lt;BR /&gt;} TCA_ADCCFG_ARRAY;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void ConvertADCChan(ADC_MOD_TYPE adcMod, uint16_t adcChan) {&lt;BR /&gt;ADC_Type* ADC;&lt;BR /&gt;&lt;BR /&gt;switch (adcMod) {&lt;BR /&gt;case MODULE_0:&lt;BR /&gt;ADC = ADC0;&lt;BR /&gt;break;&lt;BR /&gt;case MODULE_1:&lt;BR /&gt;ADC = ADC1;&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;ADC = ADC0;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/* For SW trigger mode, SC1[0] is used */&lt;BR /&gt;ADC-&amp;gt;aSC1[0] = ADC_aSC1_ADCH(adcChan); // Initiate Conversion&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;uint8_t ADCComplete(ADC_MOD_TYPE adcMod) {&lt;BR /&gt;ADC_Type* ADC;&lt;BR /&gt;&lt;BR /&gt;switch (adcMod) {&lt;BR /&gt;case MODULE_0:&lt;BR /&gt;ADC = ADC0;&lt;BR /&gt;break;&lt;BR /&gt;case MODULE_1:&lt;BR /&gt;ADC = ADC1;&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;ADC = ADC0;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;return ((ADC-&amp;gt;aSC1[0] &amp;amp; ADC_aSC1_COCO_MASK)&amp;gt;&amp;gt;ADC_aSC1_COCO_SHIFT);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;uint32_t ReadADCChx(ADC_MOD_TYPE adcMod) {&lt;BR /&gt;uint16_t adc_result=0;&lt;BR /&gt;ADC_Type* ADC;&lt;BR /&gt;&lt;BR /&gt;switch (adcMod) {&lt;BR /&gt;case MODULE_0:&lt;BR /&gt;ADC = ADC0;&lt;BR /&gt;break;&lt;BR /&gt;case MODULE_1:&lt;BR /&gt;ADC = ADC1;&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;ADC = ADC0;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/* For SW trigger mode, R[0] is used */&lt;BR /&gt;adc_result = ADC-&amp;gt;aR[0];&lt;BR /&gt;adc_result &amp;amp;= 0x00000FFF;&lt;BR /&gt;return (uint32_t) adc_result;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;for (i=0;i&amp;lt;NUMBER_OF_CHANNELS;i++) {&lt;BR /&gt;ConvertADCChan(MON_ADC.var[i].mod, MON_ADC.var[i].chan);&lt;BR /&gt;while(ADCComplete(MON_ADC.var[i].mod)==0){}&lt;BR /&gt;MON_value[i] = ReadADCChx(MON_ADC.var[i].mod);&lt;BR /&gt;}&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:18:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Multiple-ADC-channel-with-SW-trigger/m-p/1411236#M6979</guid>
      <dc:creator>dasitor</dc:creator>
      <dc:date>2022-02-09T17:18:15Z</dc:date>
    </item>
  </channel>
</rss>

