Community
cancel
Showing results for 
Search instead for 
Did you mean: 
BMist2
Novice
924 Views

UART0 Enable and Disable for D2000

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

3 Replies
Oliver_M_Intel
Employee
72 Views

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

BMist2
Novice
72 Views

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

Oliver_M_Intel
Employee
72 Views

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

Reply