Uart issue

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

Uart issue

346 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by manish87 on Mon Mar 19 20:40:47 MST 2012
I am using LPC 1114.
I have downloaded the sample code given on site and made 3 connection for :-
1. ground
2. Rx
3. Tx
I am also using real term to see the output, the rate is set as 115200
but On running as mcu application when I am sending 'a + LR or +CF' by pressing 'send ascii'  I am getting back 'X'
this is neither the exact character send returned nor I am able to debug/point out the issue.
0 Kudos
4 Replies

336 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Mar 19 23:08:43 MST 2012

Quote: Zero
MCU UART is a 3.3V output. For RS232 you need a chip to convert 3.3V to RS232 e.g MAX 3221 :)



It's amazing how much damage one can do without even using a simple thing as a voltmeter :D
If manish87 is lucky he even has an 'old school' RS232 port (going from -12 to +12V) rendering his UART pins on the MCU useless :eek:

I would recommend to use an UM232H module: this module can be mounted on a bread board, it provides target (5 or 3.3V) supply when not using the LPC-Link and has all kinds of serial and parallel protocols that may be nice for other projects.
Or use one of the almost ready to use cables with 0.1" female connectors (also available as bare wire version).

I find the UM232H modules the most easy to use for my projects - it just plugs into a 28 pin DIL socket and is very versatile (UART, SPI, I2C, JTAG, Parallel - just name it and this little gadget will do it).

Regards,
[INDENT]Rob
[/INDENT]
0 Kudos

336 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Mar 19 21:40:21 MST 2012

Quote: manish87
i have connected them to rs232 9 pin connector
gnd to gnd
rx to tx
tx to rx
the connector is connecting my pc to the board.



You are kidding me :rolleyes:

MCU UART is a 3.3V output. For RS232 you need a chip to convert 3.3V to RS232 e.g MAX 3221 :)


Or you can use a FTDI chip to convert to USB :eek:

See also : http://knowledgebase.nxp.com/showthread.php?t=2709
0 Kudos

336 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by manish87 on Mon Mar 19 21:31:47 MST 2012
i have downloaded all the sample code,
but building and running uart one [PHP]
[LEFT]#include "driver_config.h"
#include "target_config.h"

#include "uart.h"

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

int main (void) {
/* 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(UART_BAUD);

#if MODEM_TEST
ModemInit();
#endif

while (1)
{ /* Loop forever */
if ( UARTCount != 0 )
{
LPC_UART->IER = IER_THRE | IER_RLS; /* Disable RBR */
UARTSend( (uint8_t *)UARTBuffer, UARTCount );
UARTCount = 0;
LPC_UART->IER = IER_THRE | IER_RLS | IER_RBR; /* Re-enable RBR */
}
}
}[/LEFT]
[/PHP]

i have connected them to rs232 9 pin connector
gnd to gnd
rx to tx
tx to rx
the connector is connecting my pc to the board.
0 Kudos

336 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Mar 19 20:55:29 MST 2012

Quote: manish87
I have downloaded the sample code given on site.



What are we talking about ? UART sample :confused:


Quote: manish87
and made 3 connection for :-
1. ground
2. Rx
3. Tx



And then you connected them to :confused:
0 Kudos