EmbeddedRelated.com
Forums

Driving UART And find Baud Rate through PC

Started by Mohammad August 10, 2012
Hi
I have a problem with UART that I don't know where is stems from.
In the program I simply send a character to PC port(baud rate 9600). when I use terminal of flash magic software I see the character but when I use other third-party software(Docklight, Tera Term) I don't receive anything and even my micro doesn't work anymore till I close the program. It seems to me I have an error in baud rate and the Applications can't detect this error apart from Flash magic. if my assumption is right would you please tell me how can i find real baud rate in my PC?
Thank you

An Engineer's Guide to the LPC2100 Series

Check DTR and RTS state in Tera Term, if you use flash magic to program
your board most probably these ar connected to reset and bootloader pins.
If Tera Term asserts these your program won't run.

Regards,
Bernardo Marques.

On Fri, Aug 10, 2012 at 11:38 AM, Mohammad wrote:

> **
> Hi
> I have a problem with UART that I don't know where is stems from.
> In the program I simply send a character to PC port(baud rate 9600). when
> I use terminal of flash magic software I see the character but when I use
> other third-party software(Docklight, Tera Term) I don't receive anything
> and even my micro doesn't work anymore till I close the program. It seems
> to me I have an error in baud rate and the Applications can't detect this
> error apart from Flash magic. if my assumption is right would you please
> tell me how can i find real baud rate in my PC?
> Thank you
>
>
>


Thanks for your help. DTR caused the problem.

--- In l..., Bernardo Marques wrote:
>
> Check DTR and RTS state in Tera Term, if you use flash magic to program
> your board most probably these ar connected to reset and bootloader pins.
> If Tera Term asserts these your program won't run.
>
> Regards,
> Bernardo Marques.
>
> On Fri, Aug 10, 2012 at 11:38 AM, Mohammad wrote:
>
> > **
> >
> >
> > Hi
> > I have a problem with UART that I don't know where is stems from.
> > In the program I simply send a character to PC port(baud rate 9600). when
> > I use terminal of flash magic software I see the character but when I use
> > other third-party software(Docklight, Tera Term) I don't receive anything
> > and even my micro doesn't work anymore till I close the program. It seems
> > to me I have an error in baud rate and the Applications can't detect this
> > error apart from Flash magic. if my assumption is right would you please
> > tell me how can i find real baud rate in my PC?
> > Thank you
> >
> >
> >
>
>

#include "lpc17xx_uart.h"
#include "lpc17xx_libcfg.h"
#include "lpc17xx_pinsel.h"
#define UART_PORT 0
#define TEST_UART LPC_UART0
uint8_t menu1[] = "Hello NXP Semiconductors \n\r";
void print_menu(void);
void print_menu(void)
{
UART_Send(TEST_UART, menu1, sizeof(menu1), BLOCKING);

}
//



Try using a serial port monitor,
http://www.eltima.com/products/serial-port-monitor, with that you can see
exactly what is happening. I find it invaluable.

For serial port work I use that tool for debugging and indigo from shadeBlue
as a terminal, that's by far the most useful serial terminal I've found.
Also a very helpful company, they added new features I requested in a couple
of days.

Regards

Phil.

From: l... [mailto:l...] On Behalf Of
Nasim Asadollahi
Sent: 18 August 2012 20:28
To: l...
Subject: Re: [lpc2000] Driving UART And find Baud Rate through PC

#include "lpc17xx_uart.h"
#include "lpc17xx_libcfg.h"
#include "lpc17xx_pinsel.h"
#define UART_PORT 0
#define TEST_UART LPC_UART0
uint8_t menu1[] = "Hello NXP Semiconductors \n\r";
void print_menu(void);
void print_menu(void)
{
UART_Send(TEST_UART, menu1, sizeof(menu1), BLOCKING);

}
//============================================= int c_entry(void)
{
// UART Configuration structure variable
UART_CFG_Type UARTConfigStruct;
// UART FIFO configuration Struct variable
UART_FIFO_CFG_Type UARTFIFOConfigStruct;
// Pin configuration for UART
PINSEL_CFG_Type PinCfg;

// / Initialize UART0 pin connect
PinCfg.Funcnum = 1;
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
PinCfg.Pinnum = 2;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg);//P0.2 TXD0
PinCfg.Pinnum = 3;
PINSEL_ConfigPin(&PinCfg);//P0.3 RXD0

/* Initialize UART Configuration parameter structure to default
state:
* Baudrate = 9600bps
* 8 data bit
* 1 Stop bit
* None parity
*/
UART_ConfigStructInit(&UARTConfigStruct);
// Initialize UART0 & peripheral with given to corresponding
parameter
UART_Init(TEST_UART, &UARTConfigStruct);
/* Initialize FIFOConfigStruct to default state:
* - FIFO_DMAMode = DISABLE
* - FIFO_Level = UART_FIFO_TRGLEV0
* - FIFO_ResetRxBuf = ENABLE
* - FIFO_ResetTxBuf = ENABLE
* - FIFO_State = ENABLE
*/
UART_FIFOConfigStructInit(&UARTFIFOConfigStruct);

// Initialize FIFO for UART0 & peripheral
UART_FIFOConfig(TEST_UART, &UARTFIFOConfigStruct);

// Enable UART Transmit
UART_TxCmd(TEST_UART, ENABLE);
// print welcome screen
print_menu();
}
//========================= int main(void)
{
return c_entry();
}
//=======================#ifdef DEBUG

/***************************************************************************
****
* @brief Reports the name of the source file and the source
line number
* where the CHECK_PARAM error has occurred.
* @param[in] file Pointer to the source file name
* @param[in] line assert_param error line source number
* @return None

****************************************************************************
***/
void check_failed(uint8_t *file, uint32_t line)
{
/* User can add his own implementation to report the file name and
line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file,
line) */

/* Infinite loop */
while(1);
}
#endif
====================
KEIL LPC17xx
add
startup_LPC17xx.s
core_cm3.c
system_LPC17xx.c
Driver:
lpc17xx_clkpwr.c
lpc17xx_uart.c
lpc17xx_pinsel.c

________________________________
From: Mohammad >
To: l...
Sent: Friday, 10 August 2012, 15:08:20
Subject: [lpc2000] Driving UART And find Baud Rate through PC
Hi

I have a problem with UART that I don't know where is stems from.

In the program I simply send a character to PC port(baud rate 9600). when I
use terminal of flash magic software I see the character but when I use
other third-party software(Docklight, Tera Term) I don't receive anything
and even my micro doesn't work anymore till I close the program. It seems to
me I have an error in baud rate and the Applications can't detect this error
apart from Flash magic. if my assumption is right would you please tell me
how can i find real baud rate in my PC?

Thank you







--- In l..., "Phil Young" wrote:
>
> Try using a serial port monitor,
> http://www.eltima.com/products/serial-port-monitor, with that you can see
> exactly what is happening. I find it invaluable.

Do you know of anything that's FREE.

don

http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
http://com0com.sourceforge.net/

On Mon, Aug 20, 2012 at 1:04 AM, Donald H wrote:

> **
> --- In l..., "Phil Young" wrote:
> >
> > Try using a serial port monitor,
> > http://www.eltima.com/products/serial-port-monitor, with that you can
> see
> > exactly what is happening. I find it invaluable.
>
> Do you know of anything that's FREE.
>
> don
>
>
>

--
/* Jumping Flowers */


UART0 is on some boards used to support Flash Magic. I.e. 2 pins of your serial connector are used to initiate the boot process.
You might like to use a serial cable that only connects Rx, Tx and Gnd to UART0.
Henry

Both of these tools have a free evaluation period, which should be
sufficient to solve your problems.

From: l... [mailto:l...] On Behalf Of
Donald H
Sent: 20 August 2012 05:05
To: l...
Subject: [lpc2000] Re: Driving UART And find Baud Rate through PC

--- In l... , "Phil
Young" wrote:
>
> Try using a serial port monitor,
> http://www.eltima.com/products/serial-port-monitor, with that you can see
> exactly what is happening. I find it invaluable.

Do you know of anything that's FREE.

don