We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I'm sorry , My English is very bad ; I working UART0 send a receive (LPC2104) but receive I don't want to work. below code
int getchar (void) /* Read character from Serial Port */ {while (!(U0LSR & 0x01)); return (U0RBR); }
I wants to do ; pc send (hyperterminal or docklight) 'LED1 ON' or 'LED1 OFF' if(U0RBR=='LED1 ON') {event} else if(U0RBR=='LED1 OFF') {event} not work
help me , thanks
It's better than I could do any any other language!
Do you have the LPC2104 documentation in your own language?
The documentation is absolutely fundamental to understanding how the chip woprks and, thus, how to use it. If you can't get it in an understandable formm then that is a serious problem!
if( U0RBR == 'LED1 ON' )
In 'C', strings need to be enclosed in double quotes - thus: "LED1 ON"
In 'C', the == operator does not compare the contents of strings.
Think about how many characters can the U0RBR register hold? And how, then, can you compare it to a string??
Sorry, that should read:
"The documentation is absolutely fundamental to understanding how the chip works and, thus, how to use it. If you can't get it in an understandable form, then that is a serious problem!"
agree totally.
an embedded programmer who is unable / unwilling to read the datasheet should be fired on the spot.
That's a bit hard on someone who may otherwise be a fine programmer but just has difficulty with English as a foreign language.
How many native English speaking programmers could meet that criterion in any other language...?
Anyhow, one of the key criteria in selecting parts to use must be the availability of usable documentation.