<?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 ADC via Debugout in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534735#M10879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Analog2Can on Mon May 05 11:30:45 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to see the output of the ADC from my LPC11C24 on my console. I'm using the adc example (nxp_lpcxpresso_11c24_periph_adc). I already defined DEBUG_ENABLE and DEBUG_SEMIHOSTING but I don't get anything on my Console. This is what the example code look like. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;#include "board.h"
#include &amp;lt;stdio.h&amp;gt;

#if !defined(CHIP_LPC1125)

/*****************************************************************************
 * Private types/enumerations/variables
 ****************************************************************************/

static ADC_CLOCK_SETUP_T ADCSetup;

/*****************************************************************************
 * Public types/enumerations/variables
 ****************************************************************************/

/*****************************************************************************
 * Private functions
 ****************************************************************************/

static void Init_ADC_PinMux(void)
{
#if (defined(BOARD_NXP_XPRESSO_11U14) || defined(BOARD_NGX_BLUEBOARD_11U24))
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 11, FUNC2);
#elif defined(BOARD_NXP_XPRESSO_11C24)
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO0_11, FUNC2);
#else
#error "Pin muxing for ADC not configured"
#endif
}

/*****************************************************************************
 * Public functions
 ****************************************************************************/

/**
 * @briefmain routine for ADC example
 * @returnFunction should not exit
 */
int main(void)
{
uint16_t dataADC;
int j;

SystemCoreClockUpdate();
Board_Init();
Init_ADC_PinMux();
DEBUGSTR("ADC Demo\r\n");

/* ADC Init */
Chip_ADC_Init(LPC_ADC, &amp;amp;ADCSetup);
Chip_ADC_EnableChannel(LPC_ADC, ADC_CH0, ENABLE);

while (1) {
/* Start A/D conversion */
Chip_ADC_SetStartMode(LPC_ADC, ADC_START_NOW, ADC_TRIGGERMODE_RISING);

/* Waiting for A/D conversion complete */
while (Chip_ADC_ReadStatus(LPC_ADC, ADC_CH0, ADC_DR_DONE_STAT) != SET) {}

/* Read ADC value */
Chip_ADC_ReadValue(LPC_ADC, ADC_CH0, &amp;amp;dataADC);

/* Print ADC value */
DEBUGOUT("ADC value is 0x%x\r\n", dataADC);

/* Delay */
j = 500000;
while (j--) {}
}

/* Should not run to here */
return 0;
}

#endif /* !defined(CHIP_LPC1125) */
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do anybody have an idea what I'm doing wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:33:43 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:33:43Z</dc:date>
    <item>
      <title>ADC via Debugout</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534735#M10879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Analog2Can on Mon May 05 11:30:45 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to see the output of the ADC from my LPC11C24 on my console. I'm using the adc example (nxp_lpcxpresso_11c24_periph_adc). I already defined DEBUG_ENABLE and DEBUG_SEMIHOSTING but I don't get anything on my Console. This is what the example code look like. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;#include "board.h"
#include &amp;lt;stdio.h&amp;gt;

#if !defined(CHIP_LPC1125)

/*****************************************************************************
 * Private types/enumerations/variables
 ****************************************************************************/

static ADC_CLOCK_SETUP_T ADCSetup;

/*****************************************************************************
 * Public types/enumerations/variables
 ****************************************************************************/

/*****************************************************************************
 * Private functions
 ****************************************************************************/

static void Init_ADC_PinMux(void)
{
#if (defined(BOARD_NXP_XPRESSO_11U14) || defined(BOARD_NGX_BLUEBOARD_11U24))
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 11, FUNC2);
#elif defined(BOARD_NXP_XPRESSO_11C24)
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO0_11, FUNC2);
#else
#error "Pin muxing for ADC not configured"
#endif
}

/*****************************************************************************
 * Public functions
 ****************************************************************************/

/**
 * @briefmain routine for ADC example
 * @returnFunction should not exit
 */
int main(void)
{
uint16_t dataADC;
int j;

SystemCoreClockUpdate();
Board_Init();
Init_ADC_PinMux();
DEBUGSTR("ADC Demo\r\n");

/* ADC Init */
Chip_ADC_Init(LPC_ADC, &amp;amp;ADCSetup);
Chip_ADC_EnableChannel(LPC_ADC, ADC_CH0, ENABLE);

while (1) {
/* Start A/D conversion */
Chip_ADC_SetStartMode(LPC_ADC, ADC_START_NOW, ADC_TRIGGERMODE_RISING);

/* Waiting for A/D conversion complete */
while (Chip_ADC_ReadStatus(LPC_ADC, ADC_CH0, ADC_DR_DONE_STAT) != SET) {}

/* Read ADC value */
Chip_ADC_ReadValue(LPC_ADC, ADC_CH0, &amp;amp;dataADC);

/* Print ADC value */
DEBUGOUT("ADC value is 0x%x\r\n", dataADC);

/* Delay */
j = 500000;
while (j--) {}
}

/* Should not run to here */
return 0;
}

#endif /* !defined(CHIP_LPC1125) */
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do anybody have an idea what I'm doing wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534735#M10879</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: ADC via Debugout</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534736#M10880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Analog2Can on Mon May 05 12:09:53 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I solved it. You just have to click on &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Quickstart Panel &amp;gt; Quick Settings &amp;gt; Set library type &amp;gt; Redlib (semihost)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Done. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534736#M10880</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: ADC via Debugout</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534737#M10881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Tue May 06 01:42:39 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Glad you got it working. For future reference, the LPCOpen FAQ on using the debugout functionality does mention the need to switch on semihosting in LPCXpresso:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcopen-debug-inputoutput-support" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcopen-debug-inputoutput-support&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[in the section 'Additional information on setting up semihosting'].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-via-Debugout/m-p/534737#M10881</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:45Z</dc:date>
    </item>
  </channel>
</rss>

