<?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: LPC1769 Unable to make UART2 work [SOLVED] in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516145#M1520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kakikou on Wed Jul 22 05:39:49 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh they weren't set up but anyway problem solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My stupidity, i didn'nt notice that p0.10 and P0.11 were on rx2 and tx2&amp;nbsp; and since the schematics (custom board) are shitty, there was'nt a way to be sure of where the connection was done.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to only use P010 and P011 instead of P2.x&amp;nbsp; and it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SO THANKS A LOT !!!&amp;nbsp; ;-) &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:21:12 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:21:12Z</dc:date>
    <item>
      <title>LPC1769 Unable to make UART2 work [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516141#M1516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kakikou on Wed Jul 22 01:38:03 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi there, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since yesterday i'm struggling to make UART2 work on myn 1769.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried using the example code in the lpcopen example list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't forget to set the pins 2.8 and 2.9 in peripherial mode (IOCON_FUNC2 if i'm not mistaken), and even in gpio mode i can't change the pin state (checked with a scope).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But i'm sure that this UART works since i have a binary that ccommunicates via this one, so it's not a physical issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really don't know what to check , or what i did forgot to initialize to make it work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx for your anwsers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code i used , mainly inspired by the example code&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;/*
===============================================================================
 Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : testuart.c
 Author&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $(author)
 Version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :
 Copyright&amp;nbsp;&amp;nbsp; : $(copyright)
 Description : main definition
===============================================================================
*/

#if defined (__USE_LPCOPEN)
#if defined(NO_BOARD_LIB)
#include "chip.h"
#else
#include "board.h"
#endif
#endif

#include &amp;lt;cr_section_macros.h&amp;gt;
#define UART_SELECTION LPC_UART2
#define IRQ_SELECTION UART2_IRQn
#define HANDLER_NAME UART2_IRQHandler



/* Transmit and receive ring buffers */
STATIC RINGBUFF_T txring, rxring;

/* Transmit and receive ring buffer sizes */
#define UART_SRB_SIZE 128/* Send */
#define UART_RRB_SIZE 32/* Receive */

/* Transmit and receive buffers */
static uint8_t rxbuff[UART_RRB_SIZE], txbuff[UART_SRB_SIZE];

const char inst1[] = "LPC17xx/40xx UART example using ring buffers\r\n";
const char inst2[] = "Press a key to echo it back or ESC to quit\r\n";

// TODO: insert other include files here

// TODO: insert other definitions and declarations here


/**
 * @briefUART 0 interrupt handler using ring buffers
 * @returnNothing
 */
void HANDLER_NAME(void)
{
/* Want to handle any errors? Do it here. */

/* Use default ring buffer handler. Override this with your own
&amp;nbsp;&amp;nbsp; code if you need more capability. */
Chip_UART_IRQRBHandler(UART_SELECTION, &amp;amp;rxring, &amp;amp;txring);
}

int main(void) {

uint8_t key;
int bytes;

SystemCoreClockUpdate();
Board_Init();
Board_UART_Init(UART_SELECTION);
Board_LED_Set(0, false);

/* Setup UART for 115.2K8N1 */
Chip_UART_Init(UART_SELECTION);
Chip_UART_SetBaud(UART_SELECTION, 115200);
Chip_UART_ConfigData(UART_SELECTION, (UART_LCR_WLEN8 | UART_LCR_SBS_1BIT));
Chip_UART_SetupFIFOS(UART_SELECTION, (UART_FCR_FIFO_EN | UART_FCR_TRG_LEV2));
Chip_UART_TXEnable(UART_SELECTION);

/* Before using the ring buffers, initialize them using the ring
&amp;nbsp;&amp;nbsp; buffer init function */
RingBuffer_Init(&amp;amp;rxring, rxbuff, 1, UART_RRB_SIZE);
RingBuffer_Init(&amp;amp;txring, txbuff, 1, UART_SRB_SIZE);

/* Reset and enable FIFOs, FIFO trigger level 3 (14 chars) */
Chip_UART_SetupFIFOS(UART_SELECTION, (UART_FCR_FIFO_EN | UART_FCR_RX_RS |
UART_FCR_TX_RS | UART_FCR_TRG_LEV3));

/* Enable receive data and line status interrupt */
Chip_UART_IntEnable(UART_SELECTION, (UART_IER_RBRINT | UART_IER_RLSINT));

/* preemption = 1, sub-priority = 1 */
NVIC_SetPriority(IRQ_SELECTION, 1);
NVIC_EnableIRQ(IRQ_SELECTION);

/* Send initial messages */
Chip_UART_SendRB(UART_SELECTION, &amp;amp;txring, inst1, sizeof(inst1) - 1);
Chip_UART_SendRB(UART_SELECTION, &amp;amp;txring, inst2, sizeof(inst2) - 1);

/* Poll the receive ring buffer for the ESC (ASCII 27) key */
key = 0;
while (key != 27) {
Chip_UART_SendRB(UART_SELECTION, &amp;amp;txring, "UUUUUUUUUUUUUUUUUUUUUUUUUUUU", 28);

}

/* DeInitialize UART0 peripheral */
NVIC_DisableIRQ(IRQ_SELECTION);
Chip_UART_DeInit(UART_SELECTION);

return 1;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:21:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516141#M1516</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 Unable to make UART2 work [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516142#M1517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Wed Jul 22 02:53:49 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;PCUART2 bit in PCONP?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you disable default board setup to P0[10]/P0[11]&amp;nbsp; :quest: &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;{0,&amp;nbsp; 10,&amp;nbsp; IOCON_MODE_INACT | IOCON_FUNC1},/* TXD2 */
{0,&amp;nbsp; 11,&amp;nbsp; IOCON_MODE_INACT | IOCON_FUNC1},/* RXD2 */
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:21:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516142#M1517</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 Unable to make UART2 work [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516143#M1518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kakikou on Wed Jul 22 05:23:21 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;i'm pretty sure thaht the PCONP is done by the Chip_Clock_EnablePeriphClock().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't knew aboit the P0 10 and p 0 11.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By saying desactivate them, you mean put them in IOCON_FUNC0 ? &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:21:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516143#M1518</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 Unable to make UART2 work [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516144#M1519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Wed Jul 22 05:35:06 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: kakikou&lt;/STRONG&gt;&lt;BR /&gt;i'm pretty sure thaht the PCONP is done by the Chip_Clock_EnablePeriphClock().&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And debugger is confiming that&amp;nbsp; :quest: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: kakikou&lt;/STRONG&gt;&lt;BR /&gt;By saying desactivate them, you mean put them in IOCON_FUNC0 ?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just check their setup in board_sysinit.c&amp;nbsp; :O &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:21:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516144#M1519</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 Unable to make UART2 work [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516145#M1520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kakikou on Wed Jul 22 05:39:49 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh they weren't set up but anyway problem solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My stupidity, i didn'nt notice that p0.10 and P0.11 were on rx2 and tx2&amp;nbsp; and since the schematics (custom board) are shitty, there was'nt a way to be sure of where the connection was done.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to only use P010 and P011 instead of P2.x&amp;nbsp; and it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SO THANKS A LOT !!!&amp;nbsp; ;-) &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:21:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-Unable-to-make-UART2-work-SOLVED/m-p/516145#M1520</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:21:12Z</dc:date>
    </item>
  </channel>
</rss>

