3 Replies Latest reply on Mar 24, 2016 4:34 AM by OliverM

    UART0 Enable and Disable for D2000

    ByteMaster

      Hi All,

      How to Enable and Disable ONLY UART peripheral in Intel Quark D2000?

       

      To Enable:

      /* Enable peripheral clock and UARTA */
        clk_periph_enable(CLK_PERIPH_CLK | CLK_PERIPH_UARTA_REGISTER);
      

       

      and to disable:

      /* Disable peripheral clock and UARTA */
        clk_periph_disable(CLK_PERIPH_UARTA_REGISTER);
      

       

      or it need to disable both Peripheral clock and UART module too?

      /* Disable peripheral clock and UARTA */
        clk_periph_disable(CLK_PERIPH_CLK | CLK_PERIPH_UARTA_REGISTER);
      

       

      Also,

      How much Current is drawn when UART module is Enabled?

       

      Thanks

        • 1. Re: UART0 Enable and Disable for D2000
          OliverM

          Hi

           

          The code you have listed above for enabling the UART interface is correct.  To disable you only need to specify the UART interface:

          clk_periph_disable(CLK_PERIPH_UARTA_REGISTER);

           

          Including CLK_PERIPH_CLK will disable all peripherals.

           

          We will get back to you on the current question.

           

          Thanks,

           

          Oliver

          • 2. Re: UART0 Enable and Disable for D2000
            ByteMaster

            Hi Oliver,

            Thank you for reply.

            However I tried by removing following line from UART configuration
            clk_periph_enable(CLK_PERIPH_CLK | CLK_PERIPH_UARTA_REGISTER);

             

            and surprisingly UART functions still works!

            Could you plz check if that's is the case with you too?

             

            Thank you

            • 3. Re: UART0 Enable and Disable for D2000
              OliverM

              Hi

               

              Apologies for the delay in getting back to you.  Once the main clock has been enabled by the hardware, the peripheral clocks to UART and SPI are enabled hence why you were able to use the UART function without explicitly enabling it in your code first.  This is explained in more detail in section 7.2.5 of the D2000 Datasheet.

               

               

              Regarding the query about how much current is drawn when UART is enabled, this very much depends on the design of your platform which is using the UART interface on the D2000.  Is you query related to the MCU silicon itelf, or the overall board platform?  The silicon figures we have would not take into account IO considerations etc.

               

              Thanks,

               

              Oliver