LPC1769 printf

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

LPC1769 printf

855 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lithium on Thu May 12 06:43:42 MST 2011
Hi forum users,

I am trying to send data through uart port 0, i am also using the function printf.
The communication to my computers works fine.
I added this function in my main file:
int __write (int iFileHandle, uint8_t *pcBuffer, uint8_t iLength)
{
//this function is writing the printf buffer to uart
 UARTSend(0,pcBuffer,iLength);
 return iLength;
}


I have got one problem.
I am sending this:
printf("Setup started \n");

I receive this:
~.(...6.Setup started


I think something is going wrong because i got those trange characters: ~.(...6.
I made a search but could not find any information related to my problem.
Could someone help me please?

Lithium
0 Kudos
13 Replies

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lithium on Thu May 12 13:28:03 MST 2011
I don't know if it's an FTD, there is no brand on the converter.
Will do my best to give more details at my first post, thougth it didn't matter because it's just uart sending and the parameters of the extern hardware are good.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 12 13:06:10 MST 2011

Quote: Lithium

I do have an serial usb converter but i do not have a max232 to convert it.



If it is an FTDI Usb to Serial adapter with ttl levels you can connect UART0 RX and TX directly to the adapter and the USB end to the PCs USB port.  You don't need a max232 in this case.

Try that.  I think you will find it to be an xbee problem.

I just noticed Zero's post.:)

You should have been more detail specific in your first post. Mentioning  the xbee and what board you were using would have saved us a lot of time in trying to help you.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lithium on Thu May 12 12:45:40 MST 2011
I do have an serial usb converter but i do not have a max232 to convert it.

2 stop bits does not work for me, tried it at 115200 and 2 stop bits.
I am receiving less data.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu May 12 12:43:20 MST 2011
Or someone could try to use a computer and a brain:

http://www.lmgtfy.com/?q=xbee+serial+speed+115200+problem

after 6 hours barking up the wrong tree :mad:
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 12 12:33:51 MST 2011
Do you have a USB to Serial adapter you could try to connect UART0 to the PC directly.

This would eliminate the xbee from the equation and would let you know if it is a problem with your xbee to LPC1769 or xbee to PC communications.

Sorry, I don't have an xbee and probably can't help you much more.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lithium on Thu May 12 12:06:27 MST 2011
I am using this board: http://www.embeddedartists.com/products/lpcxpresso/lpc1769_xpr.php

I am also using an xbee module to connector it wireless to my computer.
The baudrate and other settings at the xbee are good.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 12 11:44:46 MST 2011

Quote: Lithium
It's an embedded artist board.



I'm confused.:confused:

Are you using an LPCXpresso1769 and an Embedded Artists Baseboard?

I thought you were only using an LPCXpresso1769.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu May 12 11:33:35 MST 2011

Quote: Lithium
It's an embedded artist board.
Setting the baud rate to 9600 works but that is not a good solution.



I'm fairly certain that I have run the RDB1768cmsis_UART_printf example as supplied on a EA baseboard before now.

Typically, problems with the UART/USB connector on the EA baseboard are jumper related. Read the EA docs, and see:

http://www.embeddedartists.com/support/faq.php?action=showfaq&faqid=43

Regards,
CodeRedSupport
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 12 11:20:15 MST 2011
To what and how are you connecting  UART0.

I can use UART0 up to 921600 baud with my FTDI USB to Serial adapter.

Can you export code?
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lithium on Thu May 12 10:43:49 MST 2011
It's an embedded artist board.
Setting the baud rate to 9600 works but that is not a good solution.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 12 10:10:30 MST 2011
Is this on an LPCXpresso 1769 board or a board you have built?

Is it possible for you to export and post the project here?
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lithium on Thu May 12 10:01:35 MST 2011
Hi,

I tried it in a loop, i got more strange characters.
I use printf after i used uart_init, i am using uart port 0.
0 Kudos

699 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 12 10:00:14 MST 2011
Try wrapping the printf in a loop and send it a few times to see if it occurs more than once.  Are you sending this right after UART0 init?
0 Kudos