Yahoo Groups archive

Lpc2000

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

Message

Re: UART0 and Printf

2006-04-24 by fordp2002

--- In lpc2000@yahoogroups.com, "ian.scanlon" <scanlon.design@...> wrote:
> 
> Does writing directly to the uart tx register work? How about putc ?
>

writing directly works very well as long as you do not overfill the
fifo's.

here is some code I wrote earlier ;)

typedef union
{
	unsigned long whole;
	unsigned char part_byte[4];
} four_bytes;

void UNDEF_Routine(void)
{
	register unsigned int *lr_ptr asm("r14");
	
	four_bytes temp;
	temp.whole = (usigned long) lr_ptr;
	UART0_THR = 	temp.part_byte[3];
	UART0_THR = 	temp.part_byte[2];
	UART0_THR = 	temp.part_byte[1];
	UART0_THR = 	temp.part_byte[0];
}

By the way thanks to the guys who helped me with reading the Link
Regitser.

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.