<?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 Re: Basic kw41z ADC Concept - Beginner in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033503#M56593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="356205" data-username="b.manojkumar521@gmail.com" href="https://community.nxp.com/people/b.manojkumar521@gmail.com" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: underline; font-size: 11.9994px;"&gt;Manoj Kumar&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your concern, hopes you are well, please take care of yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;You can run the ADC code in the SDK:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;SDK_2.2.1_FRDM-KW41Z\boards\frdmkw41z\driver_examples\adc16&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Each project contains the readme.txt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;In the board, you need to connect the your external Analog signal to:&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Connect external signal source to user-defined channel, defined by "DEMO_ADC16_USER_CHANNEL" in source code&lt;/P&gt;&lt;P&gt;&amp;nbsp; At first, I suggest you connect the&amp;nbsp;&lt;SPAN&gt;DEMO_ADC16_USER_CHANNEL to the fixed 0, VDD or other VDD divider anlog signal, to readout the ADC value. After it works, you can connect the channel to your own analog channel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;About the ADC register, you can refer to the KW41Z reference manual ADC chapater.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Wish it helps you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you still have questions about it, please kindly let me know.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Wish it helps you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Kerry&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2020 08:16:41 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2020-03-30T08:16:41Z</dc:date>
    <item>
      <title>Basic kw41z ADC Concept - Beginner</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033502#M56592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I hope everyone was safe in this difficult situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a beginner and new to this microcontroller&amp;nbsp;(KW41z).&lt;/P&gt;&lt;P&gt;I was struggling with the ADC interrupt concept.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with an example program in the&amp;nbsp;SDK&amp;nbsp;and explore the reference manual.&lt;/P&gt;&lt;P&gt;Help me to interface the analog sensor with the ADC concept?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 06:02:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033502#M56592</guid>
      <dc:creator>b_manojkumar521</dc:creator>
      <dc:date>2020-03-30T06:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Basic kw41z ADC Concept - Beginner</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033503#M56593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="356205" data-username="b.manojkumar521@gmail.com" href="https://community.nxp.com/people/b.manojkumar521@gmail.com" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: underline; font-size: 11.9994px;"&gt;Manoj Kumar&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your concern, hopes you are well, please take care of yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;You can run the ADC code in the SDK:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;SDK_2.2.1_FRDM-KW41Z\boards\frdmkw41z\driver_examples\adc16&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Each project contains the readme.txt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;In the board, you need to connect the your external Analog signal to:&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Connect external signal source to user-defined channel, defined by "DEMO_ADC16_USER_CHANNEL" in source code&lt;/P&gt;&lt;P&gt;&amp;nbsp; At first, I suggest you connect the&amp;nbsp;&lt;SPAN&gt;DEMO_ADC16_USER_CHANNEL to the fixed 0, VDD or other VDD divider anlog signal, to readout the ADC value. After it works, you can connect the channel to your own analog channel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;About the ADC register, you can refer to the KW41Z reference manual ADC chapater.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Wish it helps you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you still have questions about it, please kindly let me know.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Wish it helps you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Kerry&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 08:16:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033503#M56593</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-03-30T08:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Basic kw41z ADC Concept - Beginner</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033504#M56594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your valuable content sir,&amp;nbsp;&lt;A _jive_internal="true" data-avatarid="30129" data-externalid="" data-online="false" data-presence="null" data-userid="215657" data-username="kerryzhou" href="https://community.nxp.com/people/kerryzhou" style="color: inherit; background-color: #ffffff; border: 0px; font-weight: bold; text-decoration: none; font-size: 14px;"&gt;Kerry Zhou&lt;/A&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Can you please explain me, where my mistake in below code sir&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "board.h"&lt;BR /&gt;#include "fsl_adc16.h"&lt;/P&gt;&lt;P&gt;#include "pin_mux.h"&lt;BR /&gt;#include "clock_config.h"&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Definitions&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;#define DEMO_ADC16_BASE ADC0&lt;BR /&gt;#define DEMO_ADC16_CHANNEL_GROUP 0U&lt;BR /&gt;#define DEMO_ADC16_USER_CHANNEL 0 /* PTB18, ADC0_SE4 */&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Prototypes&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Variables&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Code&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;/*!&lt;BR /&gt; * @brief Main function&lt;BR /&gt; */&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; adc16_config_t adc16ConfigStruct;&lt;BR /&gt; adc16_channel_config_t adc16ChannelConfigStruct;&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;BR /&gt; BOARD_BootClockRUN();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;PRINTF("\r\nADC16 polling Example.\r\n");&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * adc16ConfigStruct.referenceVoltageSource = kADC16_ReferenceVoltageSourceVref;&lt;BR /&gt; * adc16ConfigStruct.clockSource = kADC16_ClockSourceAsynchronousClock;&lt;BR /&gt; * adc16ConfigStruct.enableAsynchronousClock = true;&lt;BR /&gt; * adc16ConfigStruct.clockDivider = kADC16_ClockDivider8;&lt;BR /&gt; * adc16ConfigStruct.resolution = kADC16_ResolutionSE12Bit;&lt;BR /&gt; * adc16ConfigStruct.longSampleMode = kADC16_LongSampleDisabled;&lt;BR /&gt; * adc16ConfigStruct.enableHighSpeed = false;&lt;BR /&gt; * adc16ConfigStruct.enableLowPower = false;&lt;BR /&gt; * adc16ConfigStruct.enableContinuousConversion = false;&lt;BR /&gt; */&lt;/P&gt;&lt;P&gt;ADC16_GetDefaultConfig(&amp;amp;adc16ConfigStruct);&lt;BR /&gt;#ifdef BOARD_ADC_USE_ALT_VREF&lt;BR /&gt; adc16ConfigStruct.referenceVoltageSource = kADC16_ReferenceVoltageSourceValt;&lt;BR /&gt;#endif &lt;BR /&gt; ADC16_Init(DEMO_ADC16_BASE, &amp;amp;adc16ConfigStruct);&lt;BR /&gt; ADC16_EnableHardwareTrigger(DEMO_ADC16_BASE, false); /* Make sure the software trigger is used. */&lt;BR /&gt;#if defined(FSL_FEATURE_ADC16_HAS_CALIBRATION) &amp;amp;&amp;amp; FSL_FEATURE_ADC16_HAS_CALIBRATION&lt;BR /&gt; if (kStatus_Success == ADC16_DoAutoCalibration(DEMO_ADC16_BASE))&lt;BR /&gt; {&lt;BR /&gt; PRINTF("ADC16_DoAutoCalibration() Done.\r\n");&lt;BR /&gt; PRINTF("ADC Value: %d\r\n", ADC16_GetChannelConversionValue(DEMO_ADC16_BASE, DEMO_ADC16_CHANNEL_GROUP));&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; PRINTF("ADC16_DoAutoCalibration() Failed.\r\n");&lt;BR /&gt; }&lt;BR /&gt;#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */&lt;BR /&gt; PRINTF("Press any key to get user channel's ADC value ...\r\n");&lt;/P&gt;&lt;P&gt;adc16ChannelConfigStruct.channelNumber = DEMO_ADC16_USER_CHANNEL;&lt;BR /&gt; adc16ChannelConfigStruct.enableInterruptOnConversionCompleted = false;&lt;BR /&gt;#if defined(FSL_FEATURE_ADC16_HAS_DIFF_MODE) &amp;amp;&amp;amp; FSL_FEATURE_ADC16_HAS_DIFF_MODE&lt;BR /&gt; adc16ChannelConfigStruct.enableDifferentialConversion = false;&lt;BR /&gt;#endif /* FSL_FEATURE_ADC16_HAS_DIFF_MODE */&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; GETCHAR();&lt;BR /&gt; /*&lt;BR /&gt; When in software trigger mode, each conversion would be launched once calling the "ADC16_ChannelConfigure()"&lt;BR /&gt; function, which works like writing a conversion command and executing it. For another channel's conversion,&lt;BR /&gt; just to change the "channelNumber" field in channel's configuration structure, and call the&lt;BR /&gt; "ADC16_ChannelConfigure() again.&lt;BR /&gt; */&lt;BR /&gt; ADC16_SetChannelConfig(DEMO_ADC16_BASE, DEMO_ADC16_CHANNEL_GROUP, &amp;amp;adc16ChannelConfigStruct);&lt;BR /&gt; while (0U == (kADC16_ChannelConversionDoneFlag &amp;amp;&lt;BR /&gt; ADC16_GetChannelStatusFlags(DEMO_ADC16_BASE, DEMO_ADC16_CHANNEL_GROUP)))&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt; PRINTF("ADC Value: %d\r\n", ADC16_GetChannelConversionValue(DEMO_ADC16_BASE, DEMO_ADC16_CHANNEL_GROUP));&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use the step over, it stuck in the while(1) loop itself.&lt;/P&gt;&lt;P&gt;Where would be the problem sir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2020 08:43:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033504#M56594</guid>
      <dc:creator>b_manojkumar521</dc:creator>
      <dc:date>2020-04-06T08:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Basic kw41z ADC Concept - Beginner</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033505#M56595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="356205" data-username="b.manojkumar521@gmail.com" href="https://community.nxp.com/people/b.manojkumar521@gmail.com" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 200; text-decoration: underline; font-size: 1.286rem;"&gt;Manoj Kumar&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a question, do you test the SDK ADC code on your side?&lt;/P&gt;&lt;P&gt;&amp;nbsp; That code has been tested.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Which detail ADC pin you want to use?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I find you configure&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;#define DEMO_ADC16_USER_CHANNEL 0&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Channel is the differential channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select&amp;nbsp;a single channel to test it at first.&lt;/P&gt;&lt;P&gt;Your code seems the same as the SDK ADC polling code, just modify the ADC channel. I suggest you use the SDK code directly, then input the ADC voltage in PTB18 which is the ADC channel 4.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/101393iCA7FA70CB3A004A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you want to change another ADC channel, you also need to modify the pinmux.c&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORT_SetPinMux(PORTB, PIN18_IDX, kPORT_PinDisabledOrAnalog); /* PORTB18 (pin 23) is configured as ADC0_SE4 */&lt;/P&gt;&lt;P&gt;Just change the related port as the ADC pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Wish it helps you!&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Kerry&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2020 04:52:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Basic-kw41z-ADC-Concept-Beginner/m-p/1033505#M56595</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-04-07T04:52:26Z</dc:date>
    </item>
  </channel>
</rss>

