<?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: USB DCD example for Kinetis K21 in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155801#M2776</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I have checked this project and have found that in "startup_MK21FA12.s" file doesn't define information according to USBDCD interrupt.&lt;BR /&gt;I have added the next content:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;PUBWEAK USBDCD_IRQHandler&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;PUBWEAK USB_DeviceDcdIsrFunction&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;SECTION .text:CODE:REORDER:NOROOT(2)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;USBDCD_IRQHandler&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;LDR R0, =USB_DeviceDcdIsrFunction&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;BX R0&lt;/FONT&gt;&lt;BR /&gt;and have replaced at USBDCD_IRQHandler after this coded (below) to USB_DeviceDcdIsrFunction. After this correction the USBDCD interrupt begins to work, but with not full detection. It can detect that connected the real charger - it goes to section "Depricated_charger". But in other cases, when USB is connected or not connected to PC I can't view differences: program goes to the same section: "SDP_Detected". I have transferred the USBDCD code configuration to my project to files USBCDC.c and USBCDC.h and get the same detection.&lt;BR /&gt;For me is very important to detect are my system is connected to PC USB or not connected. After detection I want to decide: do reset from the Main application and go to Bootloader or stay work with the Main application.&lt;/P&gt;&lt;P&gt;The Main application doesn't have driver communication to PC, the Main application is the Baredoard project. Therefore I have created my own USBDCD file and not use with the NXP driver.&lt;BR /&gt;I have checked my USBDCD code and don't found any differences vs original weight scale&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;project USBDCD configuration. My code is very simple but doesn't work. I am working with the Tower board. May be needed to configure any jumpers on the Tower board (I have already checked Tower documentation)? For debugger, I am using a J2 connector and fo USBDCD detection I am using with J19 connector, like for USB CDC communication. I have attached an updated project with new USBCDC files.&lt;BR /&gt;What is wrong?&lt;/P&gt;</description>
    <pubDate>Sat, 19 Sep 2020 07:15:22 GMT</pubDate>
    <dc:creator>evgenik</dc:creator>
    <dc:date>2020-09-19T07:15:22Z</dc:date>
    <item>
      <title>USB DCD example for Kinetis K21</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1152311#M2763</link>
      <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want that my MCU will available to detect USB connection.&amp;nbsp;I have read this instruction&amp;nbsp;&lt;A href="https://www.maximintegrated.com/en/design/technical-documents/tutorials/5/5936.html" target="_blank" rel="noopener"&gt;https://www.maximintegrated.com/en/design/technical-documents/tutorials/5/5936.html&lt;/A&gt;&amp;nbsp;and I am looking for a code example&amp;nbsp;for using USB DCD in Kinetis MK21FN1MAxxx12. I know that MK21 has USB Device Charger Detection Module.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How to use it to detect if my MCU is connected to the PC USB or to the charger?&lt;/LI&gt;&lt;LI&gt;There is any library for use?&lt;/LI&gt;&lt;LI&gt;Are there any restrictions on the use of this module with USB Device?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Evgeni&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 20:38:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1152311#M2763</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2020-09-11T20:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: USB DCD example for Kinetis K21</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1153704#M2768</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a sample code for the USBDCD but this is for the K70 (bare metal), you can check it and use it as a reference&lt;/P&gt;
&lt;P&gt;&lt;A class="link-titled" title="https://www.nxp.com/webapp/sps/download/license.jsp?colCode=KINETIS_120MHZ_SC" href="https://www.nxp.com/webapp/sps/download/license.jsp?colCode=KINETIS_120MHZ_SC" rel="nofollow noopener noreferrer" target="_blank"&gt;Kinetis® 120MHz bare metal sample code&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 00:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1153704#M2768</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2020-09-16T00:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: USB DCD example for Kinetis K21</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1154108#M2769</link>
      <description>&lt;P&gt;Hi Vicente.&lt;/P&gt;&lt;P&gt;Thanks for your reply. I have added your code sample to the Tower K21 CDC project. But I don't see that it's work: no interrupt, no polling mode. The function DCD_SignalTestig() all-time reads '0' (not 'Active') in every check. The project is attached. Where is a problem?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Evgeni&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 10:36:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1154108#M2769</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2020-09-16T10:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: USB DCD example for Kinetis K21</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155077#M2773</link>
      <description>&lt;P&gt;In this case maybe is better that you use the sample code on the sdk&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;dev_phdc_weightscale&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;​please check the define&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV data-tid="messageBodyContainer"&gt;
&lt;DIV data-tid="messageBodyContent"&gt;
&lt;DIV&gt;USB_DEVICE_CHARGER_DETECT_ENABLE&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;​&lt;/DIV&gt;
&lt;DIV&gt;to set the DCD&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Sep 2020 21:44:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155077#M2773</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2020-09-17T21:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: USB DCD example for Kinetis K21</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155801#M2776</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I have checked this project and have found that in "startup_MK21FA12.s" file doesn't define information according to USBDCD interrupt.&lt;BR /&gt;I have added the next content:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;PUBWEAK USBDCD_IRQHandler&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;PUBWEAK USB_DeviceDcdIsrFunction&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;SECTION .text:CODE:REORDER:NOROOT(2)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;USBDCD_IRQHandler&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;LDR R0, =USB_DeviceDcdIsrFunction&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;BX R0&lt;/FONT&gt;&lt;BR /&gt;and have replaced at USBDCD_IRQHandler after this coded (below) to USB_DeviceDcdIsrFunction. After this correction the USBDCD interrupt begins to work, but with not full detection. It can detect that connected the real charger - it goes to section "Depricated_charger". But in other cases, when USB is connected or not connected to PC I can't view differences: program goes to the same section: "SDP_Detected". I have transferred the USBDCD code configuration to my project to files USBCDC.c and USBCDC.h and get the same detection.&lt;BR /&gt;For me is very important to detect are my system is connected to PC USB or not connected. After detection I want to decide: do reset from the Main application and go to Bootloader or stay work with the Main application.&lt;/P&gt;&lt;P&gt;The Main application doesn't have driver communication to PC, the Main application is the Baredoard project. Therefore I have created my own USBDCD file and not use with the NXP driver.&lt;BR /&gt;I have checked my USBDCD code and don't found any differences vs original weight scale&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;project USBDCD configuration. My code is very simple but doesn't work. I am working with the Tower board. May be needed to configure any jumpers on the Tower board (I have already checked Tower documentation)? For debugger, I am using a J2 connector and fo USBDCD detection I am using with J19 connector, like for USB CDC communication. I have attached an updated project with new USBCDC files.&lt;BR /&gt;What is wrong?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2020 07:15:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155801#M2776</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2020-09-19T07:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: USB DCD example for Kinetis K21</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155814#M2777</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Vicente.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have checked this project and have found that in "startup_MK21FA12.s" file doesn't define information according to USBDCD interrupt.&lt;BR /&gt;I have added the next content:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;PUBWEAK USBDCD_IRQHandler&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;PUBWEAK USB_DeviceDcdIsrFunction&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;SECTION .text:CODE:REORDER:NOROOT(2)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;USBDCD_IRQHandler&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;LDR R0, =USB_DeviceDcdIsrFunction&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;BX R0 &lt;/FONT&gt;&lt;BR /&gt;and have replaced at &lt;FONT face="courier new,courier" size="3"&gt;USBDCD_IRQHandler &lt;/FONT&gt;after this coded (below) to &lt;FONT face="courier new,courier" size="3"&gt;USB_DeviceDcdIsrFunction&lt;/FONT&gt;. After this correction the USBDCD interrupt begins to work, but with not full detection. It can detect that connected the real charger - it goes to section "Depricated_charger". But in other cases, when USB is connected or not connected to PC I can't view differences: program goes to the same section: "SDP_Detected". I have transferred USBDCD code configuration to my project to files USBCDC.c and USBCDC.h and get the same detection.&lt;BR /&gt;For me is very important to detect are my system is connected to PC USB or not connected. After detection I want to decide: do reset from the Main application and go to Bootloader or stay work with the Main application.&lt;/P&gt;&lt;P&gt;The Main application doesn't have driver communication to PC, the Main application is the Baredoard project. Therefore I have created my own USBDCD file and not use with the NXP driver.&lt;BR /&gt;I have checked my USBDCD code and don't found any differences vs original weight project USBDCD configuration. My code is very simple but doesn't work. I am working with the Tower board. May be needed to configure any jumpers on the Tower board (I have already checked Tower documentation)? For debugger, I am using a J2 connector and fo USBDCD detection I am using with J19 connector, like for USB CDC communication.&lt;BR /&gt;What is wrong?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2020 13:43:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-DCD-example-for-Kinetis-K21/m-p/1155814#M2777</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2020-09-19T13:43:28Z</dc:date>
    </item>
  </channel>
</rss>

