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

I wrote a code for UART0 in LPC2148 for transmitting - it is working at debugging, but not working in proteos

sir please help me why it is not working.

uart.c.zip
  • Hi madhukar18.

    There could be a number of reasons for this.

    Are you sure that you've initialized all the necessary UART hardware registers ?

    Did you enable UART clock power ?

    (Hints: U0FCR, U0FDR, U0TER - see UM10139.pdf, section 10.3, for clock power, see the PCONP register in table 31, U0FCR in table 171, U0TER in table 176, U0FDR in table 166)

    First thing you should verify is your actual baud rate.

    If you have a logic analyzer, I recommend using it to monitor and log all your lines.

    It is recommended that you run on an external crystal, when you send data on the UART.

    -But if your baud rate is low, you can still run on the IRC oscillator.

    Questions:

    What clock frequency is your microcontroller running at ?

    What's your PCLK frequency ?

    What's baudrate do you want it to use for transferring data ?

    Are you sure U0DLL is set to the correct value ? - You may want to look at the values in table 167.

  • Assign U0DLL = 0x61;

    and     U0DLM = 0;

    U will get the result.

    And variable initializations u should not do inside while loop. Initialize i before while loop..

    Thank you.