LPC1343 UART problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1343 UART problem

2,746 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Mon Nov 18 05:11:46 MST 2013
Hello everybody,

I'm using LPCXpresso 1769 and LPCXpresso 1343 in my project ,LPC1343 sends data by uart to LPC1769, i try them separately with UART to USB, they are both working, but yesterday i try to connect them, LPC1343 didnt send any data, i disconnect and test them, LPC1769 woks properly,but LPC1343 UART doesnt work but it works all other tasks, i checked my program all pins are properly setted, uart initialize is ok, it enters interrupt when it starts and sends data but no data send or receive

It took too long, :) if anyone knows any solution or encountered this problem, any solution will be helpful, thx in advance
Labels (1)
0 Kudos
Reply
14 Replies

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by boltnut on Mon Aug 25 02:47:55 MST 2014
According to UM10375 Page 201 - 203, it needs to adjust the DIVADDVAL and MULVAL values if the baud rate is modified.
LPC13xx_Sample Software v1.07 uarttest program did NOT setup them. Why ?
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Tue Nov 19 05:53:55 MST 2013
Hello i will try this but i have exams tomorrow i m working on them i ll try you suggestions tomorrow, thanks for help
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Nov 18 14:17:44 MST 2013
To get slower baudrates it's possible to set UARTCLKDIV higher.

Sample:
void UARTInit(uint32_t baudrate)
{
...
  LPC_SYSCON->UARTCLKDIV = [color=#f00]100[/color];     /* divided by 1 */
...


/*****************************************************************************
 *   uarttest.c:  UART test C file for NXP LPC13xx Family Microprocessors
 *
 *   Copyright(C) 2008, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2008.08.20  ver 1.00    Preliminary version, first Release
 *
******************************************************************************/
#include "LPC13xx.h"
#include "uart.h"

extern volatile uint32_t UARTCount;
extern volatile uint8_t UARTBuffer[BUFSIZE];

int main (void) {
volatile uint32_t i;
  /* Basic chip initialization is taken care of in SystemInit() called
   * from the startup code. SystemInit() and chip settings are defined
   * in the CMSIS system_<part family>.c file.
   */

  /* NVIC is installed inside UARTInit file. */
  UARTInit(1);              //set 1 bps, LED is showing each bit 1 second!!!!
  UARTBuffer[0]= 0b01010101;//byte to blink
  while (1) 
  {/* Loop forever */
i++;
if(i>10E6)
{
 i =0;
 UARTSend( (uint8_t *)UARTBuffer,1);
}
  }
}


This code is really working with 1 bps...
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Nov 18 10:57:27 MST 2013
Without Scope you can check your UART with a LED and slow baudrate. LPC1343 is working until 70 bps.

Transmitting 0x00 is generating a 128ms low signal. If you connect a LED and an 1k resistor you can see this LED blinking.

Sample:

/*****************************************************************************
 *   uarttest.c:  UART test C file for NXP LPC13xx Family Microprocessors
 *
 *   Copyright(C) 2008, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2008.08.20  ver 1.00    Preliminary version, first Release
 *
******************************************************************************/
#include "LPC13xx.h"
#include "uart.h"

extern volatile uint32_t UARTCount;
extern volatile uint8_t UARTBuffer[BUFSIZE];

int main (void) {
volatile uint32_t i;
  /* Basic chip initialization is taken care of in SystemInit() called
   * from the startup code. SystemInit() and chip settings are defined
   * in the CMSIS system_<part family>.c file.
   */

  /* NVIC is installed inside UARTInit file. */
  UARTInit(70);//70bps, UART isn't working lower
  UARTBuffer[0]= 0x0;
  while (1) 
  {/* Loop forever */
i++;
if(i>1E6)
{
 i =0;
 UARTSend( (uint8_t *)UARTBuffer,1);
}
  }
}
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Mon Nov 18 10:01:57 MST 2013
thx i will also try that with new mcu, thanks for all replies
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Nov 18 08:59:08 MST 2013
UART can be damaged if TX is connected to TX. I've never tried that. A good way to avoid this accidents are 2k resistors in your UART connection wires. So one UART can't fry the other...
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Mon Nov 18 08:46:49 MST 2013
:D it happened first time and i use uart everywhere :) but now i m gonna use I2C :D i ll try my chance, but i think when other mcu started its pins are not setted o UART maybe lpc1343's UART pin drive couln't handle this, maybe i must use driver or isolator, maybe rs232 or rs485 ?
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Nov 18 08:19:10 MST 2013

Quote: hunter
...but what do you think caused this damage,



You  :)

Usually they are not easy to destroy. So I would double-check your UART connection...
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Mon Nov 18 08:07:21 MST 2013
Sorry i dont have osicloscope, but i try o sen data in every baudrate with sample program but no out,

I just tried to use gpio on the pins but its not working, i think lpc1343 pins are damaged,  but MCU works only those pins :) i will order new one but what do you think caused this damage,
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Nov 18 06:36:33 MST 2013
Can you scope TX with a simple transmit loop (just transmit a byte 10 times / second) ?

If there's no signal (even with LPCXpresso sample program) your LPC1343  could be damaged. 

Are this pins working if you switch them to GPIO & OUT?

0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Mon Nov 18 06:23:10 MST 2013
No it was working, first i connect my lpc1769 to uart usb bridge and it was working , then i connect my lpc1343 tu uart usb bridge it was also working, when i connnect them to each other lpc1343's UART was gone, and when i try to connect it to uart usb bridge it was not working,

I didn't test my program, with another LPC1343 if wont work i ll buy new one,

Also rxd and txd pins are short circuited know in no power, gnd to pin resistance 4.7k, 3.3V to pin resistance 0.5M may be it helps.

thx for help and sorry for bad English :)

0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hunter on Mon Nov 18 06:14:09 MST 2013
in IO_CON i set pins rxd and txd and they are pull-up i also checked them in peripherals,
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Nov 18 05:40:49 MST 2013

Quote: hunter
i checked my program...



Could be useful to reduce your project to the basic problem and post it.

Did you change anything? Did it stop to work all over sudden?

Did you test your program with another LPC1343?
0 Kudos
Reply

2,598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Mon Nov 18 05:16:31 MST 2013
You know there is a bit to enable the GPIO input (not just direction, like in older uC)?
I can't remember the name, look in User Manual where the GPIO is described and setup (pull-up, pull-down, ...).
0 Kudos
Reply