Yahoo Groups archive

Lpc2000

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

Thread

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

[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

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

2004-10-07 by bty639886

im not near anything that can specifically help, but can you check 
that your PC side is not suppressing the NULL byte?
(I know VB has an option in the MSCOMM control to suppress the NULL.)

also, is the LPC configured to pad 0's (I cant remember if there is 
some config option for that)...

anyway, just a thought....
pete


--- In lpc2000@yahoogroups.com, Pawel Sikora <rzulfik@y...> wrote:
Show quoted textHide quoted text
> 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

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.