Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: UART0 and Printf

2006-04-24 by fordp2002

Three things to try.

1) Check your code is running at all can you flash a LED or are you
still in Boot Selector mode when you think you are running your code.

2) You have closed your Philips Flash Unitily before connecting with
Hyperterninal.

3) Try writing bytes to the U0THR, if you enable the fifo you can
write upto 16 in one go without checking if the UART is busy.

Good Luck.

--- In lpc2000@yahoogroups.com, "jstamos111" <jstamos111@...> wrote:
>
> Hey all,
> 
> I am trying to get UART0 output to display on hyperterminal for a 
> board I made based on the LPC2106 processor.  I use the ISP and 
> UART0 to program the board with Philips flash utility, then start 
> hyperterminal with the following settings: 9600 bits/second, 8 
> databits, no parity, 1 stop bit, and no flow control.  I set 
> hyperterminal to listen on the same com port as the one I used to 
> program the flash memory.  I also have the computer's com port 
> connected to the LPC2106's same UART (UART0?) that I used to program 
> the flash memory.  Finally, I hit reset, but the output is not 
> displayed in hyperterminal.
> 
> Any thoughts on why I am not seeing any output in hyperterminal?
> 
> Here is my code which I compiled uvision by keil tools.  I pretty 
> much stole this code from hitex's book for the philips LPC 
> processors.
> 
> void UART0 (void)	
> {
> PINSEL0 = 0x05; 	// Select TxD and RxD on pin connect block
> U0LCR = 0x80;		//Enable programming of divisor latches
> 
> U0DLL = 0xC2;		//Program the divisor latch for 19200 baud
> U0DLM = 0x00;
> 
> U0LCR = 0x33;		//Program the line control 8\N\1
> U0FCR = 0x4F;		//enable the FIFO's
> 			
> }
> 
> int main() {
> 	UART0();
> 
> 	printf("Hello World\n"); //Call the printf function
>         while(1) {}
>         return 0;
> }
> 
> Much Thanks.
> - John
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.