Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] borked serial port in LPC210x ???

2005-04-12 by Bill Knight

Pawel
  It might be that because the clocks on the two machines are not
EXACTLY the same,t the PC is overrunning the UART on the LPC
every so often.  For a qucik test, set the PC to send characters
with 2 stop bits, but have the LPC send them back with 1 stop bit.

Regards
-Bill Knight
R O SoftWare &
http://www.theARMPatch.com


On Tue, 12 Apr 2005 03:39:10 -0700 (PDT), Pawel Sikora wrote:

Hi all,

I wrote a simple program called "serial-echo".
It receiving bytes from PC and sending they back
to the PC. During long time transmissions
received stream is shorter in comparison to the
original stream.

    tx        rx (bytes)

   100       100
  1000      1000
 10000     10000
 20000    ~19983
 50000    ~49931
100000    ~99984

The embedded system has a 14.745MHz xtal,
enabled PLL (cclk=60MHz) and mem. acceleration
set up to MAMTIM=2/MAMCR=2.
The serial link is established at 57600,
8 data bits, no parity, 2 stop bits.

inline unsigned __get()

	while (!(UART0_LSR & 0x01));
	return UART0_RBR;
} 
inline void __put(const unsigned c)

	while (!(UART0_LSR & 0x20));
	UART0_THR = c;

int main()

	initCore(CORE_HIGH_SPEED);
	setSerialSpeed(57600);
	while (1)
	{
		__put(__get());
	}


118:eb000023 	bl	1ac <initCore>
11c:e3a00ce1 	mov	r0, #57600	; 0xe100
120:eb000270 	bl	ae8 <setSerialSpeed>
124:e3a0020e 	mov	r0, #-536870912	; 0xe0000000
128:e2800903 	add	r0, r0, #49152	; 0xc000
12c:e5903014 	ldr	r3, [r0, #20]
130:e3130001 	tst	r3, #1	; 0x1
134:0afffffc 	beq	12c <main+0x24>
138:e5901000 	ldr	r1, [r0]
13c:e3a0220e 	mov	r2, #-536870912	; 0xe0000000
140:e2822903 	add	r2, r2, #49152	; 0xc000
144:e5923014 	ldr	r3, [r2, #20]
148:e3130020 	tst	r3, #32	; 0x20
14c:0afffffc 	beq	144 <main+0x3c>
150:e5821000 	str	r1, [r2]
154:eafffff4 	b	12c <main+0x24>

Smiliar echo program works fine e.g. on PIC-18F2620.
Did I missed something?



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 



Yahoo! Groups Links

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.