Yahoo Groups archive

Lpc2000

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

Message

[lpc2104] uart0 doesn't emit 0x00 byte(s) :-O

2004-10-07 by Pawel Sikora

Hi,

I don't know what is wrong with uart0 (or my code).

testcase:

int rs232_txAvailable()
{
	return ((U0LSR & bit(5)) != 0);
}

000000a0 <rs232_txAvailable>:
  a0:   e59f300c        ldr     r3, [pc, #12]   ; b4
<.text+0xb4>
  a4:   e5930000        ldr     r0, [r3]
  a8:   e1a002a0        mov     r0, r0, lsr #5
  ac:   e2000001        and     r0, r0, #1      ; 0x1
  b0:   e1a0f00e        mov     pc, lr
  b4:   00000000        andeq   r0, r0, r0

int rs232_txByte(const unsigned byte)
{
	U0THR = byte;
	return 1;
}

000000b8 <rs232_txByte>:
  b8:   e59f3008        ldr     r3, [pc, #8]    ; c8
<.text+0xc8>
  bc:   e5830000        str     r0, [r3]
  c0:   e3a00001        mov     r0, #1  ; 0x1
  c4:   e1a0f00e        mov     pc, lr
  c8:   00000000        andeq   r0, r0, r0

while (!rs232_txAvailable());
rs232_txByte(0x01);
while (!rs232_txAvailable());
rs232_txByte(0x02);
while (!rs232_txAvailable());
rs232_txByte(0x00);
while (!rs232_txAvailable());
rs232_txByte(0x03);

The PC-terms (and port monitor) receiving only:
0x01,0x02,0x03.
Where is the 0x00?



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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.