This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

INFO UART

Dear All,

Is possible to have informations on this code?

int sendchar (int ch) { /* Write character to Serial Port */

while (!(UxLSR & 0x20)); Why??

return (UxTHR = ch); Why??
}

Thanks

Parents Reply Children
  • A quick peek in the user manual (that's the name of the "good stuff" for the LPC23xx chips) will quickly find the definition for U0LSR, U1LSR, U2LSR and U3LSR.

    The first match if you search will also tell you the symbolic name for the bit 0x20. A little extra search and you will get a full paragraph what the bit represents, and then it will be obvious why the example code waits.

    The only way to really learn is by spending time to learn. We can't learn for you.