<?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>S32KのトピックADC PDB DMA (Hardware trigger)</title>
    <link>https://community.nxp.com/t5/S32K/ADC-PDB-DMA-Hardware-trigger/m-p/1202875#M9350</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;community&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="tgt"&gt;&lt;SPAN class="tgt"&gt;I refer to the Example "Example-s32k144_pdb_adc_dma_SDK_rTM_300.7z"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="tgt"&gt;&lt;SPAN class="tgt"&gt;ADC DMA and PDB are configured, but there is no DMA interrupt. Please help to see what is wrong with my configuration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Attached is my project&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void ADC_Init(void)&lt;BR /&gt;{&lt;BR /&gt;ADC1_Init();&lt;/P&gt;&lt;P&gt;PDB1_init();&lt;/P&gt;&lt;P&gt;DMA_Init();&lt;BR /&gt;#if 1&lt;BR /&gt;// Initialize TRGMUX to route LPIT0 ch0 trigger to both PDBs and PDB's OUT pulse to TRGMUX out7&lt;BR /&gt;TRGMUX_DRV_Init(INST_TRGMUX1, &amp;amp;trgmux1_InitConfig0);&lt;/P&gt;&lt;P&gt;// Initialize LPIT instance 0. Reset and enable peripheral&lt;BR /&gt;LPIT_DRV_Init(INST_LPIT1, &amp;amp;lpit1_InitConfig);&lt;BR /&gt;// Initialize LPIT channel 0 to generate trigger for PDB via TRGMUX&lt;BR /&gt;LPIT_DRV_InitChannel(INST_LPIT1, 0, &amp;amp;lpit1_ChnConfig0);&lt;BR /&gt;// Start LPIT0 channel 0 counter&lt;BR /&gt;LPIT_DRV_StartTimerChannels(INST_LPIT1, 1);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void ADC1_Init(void)&lt;BR /&gt;{&lt;BR /&gt;ADC_DRV_AutoCalibration(INST_ADCONV1);&lt;BR /&gt;ADC_DRV_ConfigConverter(INST_ADCONV1, &amp;amp;adConv1_ConvConfig0);&lt;/P&gt;&lt;P&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 0UL, &amp;amp;adConv1_ChnConfig0);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 1UL, &amp;amp;adConv1_ChnConfig1);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 2UL, &amp;amp;adConv1_ChnConfig2);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 3UL, &amp;amp;adConv1_ChnConfig3);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 4UL, &amp;amp;adConv1_ChnConfig4);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void PDB1_init(void)&lt;BR /&gt;{&lt;BR /&gt;PDB_DRV_Init(INST_PDB1, &amp;amp;pdb1_InitConfig0);&lt;BR /&gt;PDB_DRV_Enable(INST_PDB1);&lt;/P&gt;&lt;P&gt;// config 8 pretriggers on ch0 based on component setting&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig0);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig1);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig2);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig3);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig4);&lt;/P&gt;&lt;P&gt;// config 1 pretrigger on ch1 based on component setting&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 1UL , &amp;amp;pdb1_AdcTrigInitConfig0);&lt;/P&gt;&lt;P&gt;// set PDB1 counter period to delayValue (~30us)&lt;BR /&gt;PDB_DRV_SetTimerModulusValue(INST_PDB1,(uint32_t) delayValue);&lt;BR /&gt;// set ch0 trigger delay to happen immediate upon Trigger_In 0 (PIT0 ch0)&lt;BR /&gt;PDB_DRV_SetAdcPreTriggerDelayValue(INST_PDB1, 0UL , 0UL , (uint32_t) (1));&lt;BR /&gt;// set ch1 trigger0 delay to happen 10us upon Trigger_In 0 (PIT0 ch0)&lt;BR /&gt;PDB_DRV_SetAdcPreTriggerDelayValue(INST_PDB1, 1UL , 0UL , (uint32_t) (10*delayValue/PDLY_TIMEOUT));&lt;/P&gt;&lt;P&gt;PDB_DRV_LoadValuesCmd(INST_PDB1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* This function triggers a loop memory-to-memory transfer. */&lt;BR /&gt;static void triggerLoopTransfer(uint8_t channel, uint8_t * srcBuff, uint16_t * dstBuff, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;//transferComplete = false;&lt;/P&gt;&lt;P&gt;dma_request_source_t DmaReq;&lt;/P&gt;&lt;P&gt;/* configure transfer source and destination addresses */&lt;BR /&gt;transferConfig.srcAddr = (uint32_t)srcBuff;&lt;BR /&gt;transferConfig.destAddr = (uint32_t)dstBuff;&lt;BR /&gt;transferConfig.srcLastAddrAdjust = -(4*size);&lt;BR /&gt;transferConfig.destLastAddrAdjust = -(2*size);&lt;BR /&gt;loopConfig.majorLoopIterationCount = size;&lt;/P&gt;&lt;P&gt;if(channel == 0)&lt;BR /&gt;{&lt;BR /&gt;DmaReq = EDMA_REQ_ADC0;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;DmaReq = EDMA_REQ_ADC1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* configure the eDMA channel for a loop transfer (via transfer configuration structure */&lt;BR /&gt;EDMA_DRV_ConfigLoopTransfer(channel, &amp;amp;transferConfig);&lt;/P&gt;&lt;P&gt;/* select hw request */&lt;BR /&gt;EDMA_DRV_SetChannelRequestAndTrigger(channel, DmaReq, false);&lt;/P&gt;&lt;P&gt;/* start the channel */&lt;BR /&gt;EDMA_DRV_StartChannel(channel);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void DMA_Init(void)&lt;BR /&gt;{&lt;BR /&gt;EDMA_DRV_Init(&amp;amp;dmaController1_State, &amp;amp;dmaController1_InitConfig0, edmaChnStateArray, edmaChnConfigArray, EDMA_CONFIGURED_CHANNELS_COUNT);&lt;/P&gt;&lt;P&gt;// set DMA ch0 to read first 16 ADC0 Results registers and move it to buffer array starting from 1st element&lt;BR /&gt;triggerLoopTransfer(DMA_CHANNEL0, (uint8_t *)&amp;amp;(ADC0-&amp;gt;R[0]),buffer, 16);&lt;BR /&gt;// set DMA ch1 to read first 9 ADC1 Results registers and move it to buffer array starting from 16th element&lt;BR /&gt;triggerLoopTransfer(DMA_CHANNEL1, (uint8_t *)&amp;amp;(ADC1-&amp;gt;R[0]),&amp;amp;buffer[16], 9);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 06:56:14 GMT</pubDate>
    <dc:creator>linglei_meng</dc:creator>
    <dc:date>2020-12-22T06:56:14Z</dc:date>
    <item>
      <title>ADC PDB DMA (Hardware trigger)</title>
      <link>https://community.nxp.com/t5/S32K/ADC-PDB-DMA-Hardware-trigger/m-p/1202875#M9350</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;community&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="tgt"&gt;&lt;SPAN class="tgt"&gt;I refer to the Example "Example-s32k144_pdb_adc_dma_SDK_rTM_300.7z"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="tgt"&gt;&lt;SPAN class="tgt"&gt;ADC DMA and PDB are configured, but there is no DMA interrupt. Please help to see what is wrong with my configuration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Attached is my project&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void ADC_Init(void)&lt;BR /&gt;{&lt;BR /&gt;ADC1_Init();&lt;/P&gt;&lt;P&gt;PDB1_init();&lt;/P&gt;&lt;P&gt;DMA_Init();&lt;BR /&gt;#if 1&lt;BR /&gt;// Initialize TRGMUX to route LPIT0 ch0 trigger to both PDBs and PDB's OUT pulse to TRGMUX out7&lt;BR /&gt;TRGMUX_DRV_Init(INST_TRGMUX1, &amp;amp;trgmux1_InitConfig0);&lt;/P&gt;&lt;P&gt;// Initialize LPIT instance 0. Reset and enable peripheral&lt;BR /&gt;LPIT_DRV_Init(INST_LPIT1, &amp;amp;lpit1_InitConfig);&lt;BR /&gt;// Initialize LPIT channel 0 to generate trigger for PDB via TRGMUX&lt;BR /&gt;LPIT_DRV_InitChannel(INST_LPIT1, 0, &amp;amp;lpit1_ChnConfig0);&lt;BR /&gt;// Start LPIT0 channel 0 counter&lt;BR /&gt;LPIT_DRV_StartTimerChannels(INST_LPIT1, 1);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void ADC1_Init(void)&lt;BR /&gt;{&lt;BR /&gt;ADC_DRV_AutoCalibration(INST_ADCONV1);&lt;BR /&gt;ADC_DRV_ConfigConverter(INST_ADCONV1, &amp;amp;adConv1_ConvConfig0);&lt;/P&gt;&lt;P&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 0UL, &amp;amp;adConv1_ChnConfig0);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 1UL, &amp;amp;adConv1_ChnConfig1);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 2UL, &amp;amp;adConv1_ChnConfig2);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 3UL, &amp;amp;adConv1_ChnConfig3);&lt;BR /&gt;ADC_DRV_ConfigChan(INST_ADCONV1, 4UL, &amp;amp;adConv1_ChnConfig4);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void PDB1_init(void)&lt;BR /&gt;{&lt;BR /&gt;PDB_DRV_Init(INST_PDB1, &amp;amp;pdb1_InitConfig0);&lt;BR /&gt;PDB_DRV_Enable(INST_PDB1);&lt;/P&gt;&lt;P&gt;// config 8 pretriggers on ch0 based on component setting&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig0);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig1);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig2);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig3);&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 0UL , &amp;amp;pdb1_AdcTrigInitConfig4);&lt;/P&gt;&lt;P&gt;// config 1 pretrigger on ch1 based on component setting&lt;BR /&gt;PDB_DRV_ConfigAdcPreTrigger(INST_PDB1, 1UL , &amp;amp;pdb1_AdcTrigInitConfig0);&lt;/P&gt;&lt;P&gt;// set PDB1 counter period to delayValue (~30us)&lt;BR /&gt;PDB_DRV_SetTimerModulusValue(INST_PDB1,(uint32_t) delayValue);&lt;BR /&gt;// set ch0 trigger delay to happen immediate upon Trigger_In 0 (PIT0 ch0)&lt;BR /&gt;PDB_DRV_SetAdcPreTriggerDelayValue(INST_PDB1, 0UL , 0UL , (uint32_t) (1));&lt;BR /&gt;// set ch1 trigger0 delay to happen 10us upon Trigger_In 0 (PIT0 ch0)&lt;BR /&gt;PDB_DRV_SetAdcPreTriggerDelayValue(INST_PDB1, 1UL , 0UL , (uint32_t) (10*delayValue/PDLY_TIMEOUT));&lt;/P&gt;&lt;P&gt;PDB_DRV_LoadValuesCmd(INST_PDB1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* This function triggers a loop memory-to-memory transfer. */&lt;BR /&gt;static void triggerLoopTransfer(uint8_t channel, uint8_t * srcBuff, uint16_t * dstBuff, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;//transferComplete = false;&lt;/P&gt;&lt;P&gt;dma_request_source_t DmaReq;&lt;/P&gt;&lt;P&gt;/* configure transfer source and destination addresses */&lt;BR /&gt;transferConfig.srcAddr = (uint32_t)srcBuff;&lt;BR /&gt;transferConfig.destAddr = (uint32_t)dstBuff;&lt;BR /&gt;transferConfig.srcLastAddrAdjust = -(4*size);&lt;BR /&gt;transferConfig.destLastAddrAdjust = -(2*size);&lt;BR /&gt;loopConfig.majorLoopIterationCount = size;&lt;/P&gt;&lt;P&gt;if(channel == 0)&lt;BR /&gt;{&lt;BR /&gt;DmaReq = EDMA_REQ_ADC0;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;DmaReq = EDMA_REQ_ADC1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* configure the eDMA channel for a loop transfer (via transfer configuration structure */&lt;BR /&gt;EDMA_DRV_ConfigLoopTransfer(channel, &amp;amp;transferConfig);&lt;/P&gt;&lt;P&gt;/* select hw request */&lt;BR /&gt;EDMA_DRV_SetChannelRequestAndTrigger(channel, DmaReq, false);&lt;/P&gt;&lt;P&gt;/* start the channel */&lt;BR /&gt;EDMA_DRV_StartChannel(channel);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void DMA_Init(void)&lt;BR /&gt;{&lt;BR /&gt;EDMA_DRV_Init(&amp;amp;dmaController1_State, &amp;amp;dmaController1_InitConfig0, edmaChnStateArray, edmaChnConfigArray, EDMA_CONFIGURED_CHANNELS_COUNT);&lt;/P&gt;&lt;P&gt;// set DMA ch0 to read first 16 ADC0 Results registers and move it to buffer array starting from 1st element&lt;BR /&gt;triggerLoopTransfer(DMA_CHANNEL0, (uint8_t *)&amp;amp;(ADC0-&amp;gt;R[0]),buffer, 16);&lt;BR /&gt;// set DMA ch1 to read first 9 ADC1 Results registers and move it to buffer array starting from 16th element&lt;BR /&gt;triggerLoopTransfer(DMA_CHANNEL1, (uint8_t *)&amp;amp;(ADC1-&amp;gt;R[0]),&amp;amp;buffer[16], 9);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 06:56:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ADC-PDB-DMA-Hardware-trigger/m-p/1202875#M9350</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2020-12-22T06:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: ADC PDB DMA (Hardware trigger)</title>
      <link>https://community.nxp.com/t5/S32K/ADC-PDB-DMA-Hardware-trigger/m-p/1203908#M9377</link>
      <description>&lt;P&gt;Hi linglei_meng,&lt;/P&gt;
&lt;P&gt;Please modify your project according to below images:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pdb.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/133458iB87D89A20A135BDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pdb.png" alt="pdb.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edma.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/133459iB64B86AC41939E14/image-size/large?v=v2&amp;amp;px=999" role="button" title="edma.png" alt="edma.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="trgmux.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/133460iEF2813C04D80D177/image-size/large?v=v2&amp;amp;px=999" role="button" title="trgmux.png" alt="trgmux.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Hope it helps.&lt;BR /&gt;Have a nice day!&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 03:24:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ADC-PDB-DMA-Hardware-trigger/m-p/1203908#M9377</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2020-12-24T03:24:57Z</dc:date>
    </item>
  </channel>
</rss>

