+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Member level 1
    Points: 413, Level: 4
    Twisted_transistor's Avatar
    Join Date
    Sep 2012
    Posts
    32
    Helped
    2 / 2
    Points
    413
    Level
    4

    Serial Communication using ARM LPC2148

    Hi.. I've written a code to transmit a character to PC using UART0. But, however, the hyperterminal is blank.
    Why is this happening?
    My code is as follows:

    Code C - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    #include "LPC214x.h"
    void init(void);
     
     int main()
    {   int i=0;
        init();
        
       while(i<=10){
        
                U0THR='D';
                while(!(U0LSR && 0x60));
                   i++;
                   
        }
    }   
     
    void init()
    {
        PINSEL0=0x00050005;
        U0FCR=0x07;     //enable and clear FIFOs
        U0LCR=0x83;     //8-N-1, enable divisors
        U0DLL=0x62;     //9600 baud (9615)
        U0DLM=0x00;
        U0LCR=0x03;     //8-N-1, disable divisors
    }
    Last edited by bigdogguru; 26th October 2012 at 08:00. Reason: Added Code or Syntax Tags

    •   Alt26th October 2012, 07:46

      advertising

        
       

  2. #2
    Administrator
    Points: 37,895, Level: 47
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    alexan_e's Avatar
    Join Date
    Mar 2008
    Location
    Greece
    Posts
    11,889
    Helped
    2085 / 2085
    Points
    37,895
    Level
    47
    Blog Entries
    6

    Re: Serial Communication using ARM LPC2148

    Download the LPC214x code bundle and review the UART example and the provided libraries
    http://ics.nxp.com/support/documents...4x.uvision.zip
    Please don't make requests for help in private using PM. Create a thread in the forum so that other members can benefit from the posted answers.

    Consider reading this before posting : How To Ask Questions The Smart Way



    •   Alt26th October 2012, 08:05

      advertising

        
       

  3. #3
    Member level 1
    Points: 413, Level: 4
    Twisted_transistor's Avatar
    Join Date
    Sep 2012
    Posts
    32
    Helped
    2 / 2
    Points
    413
    Level
    4

    Re: Serial Communication using ARM LPC2148

    But if I modify d same code for UART1 it works fine.. Its only giving a problem with UART0..



    •   Alt26th October 2012, 08:10

      advertising

        
       

  4. #4
    Full Member level 5
    Points: 2,342, Level: 11
    Jigar 4 Electronics's Avatar
    Join Date
    Apr 2011
    Location
    Hamilton, ON, Canada
    Posts
    313
    Helped
    40 / 40
    Points
    2,342
    Level
    11
    Blog Entries
    2

    Re: Serial Communication using ARM LPC2148

    I've tried your program on Proteus. It's working
    Here is the project file of Kei & proteus on which you can check.
    I've take it from the examples of MDK-ARM & just replace the main program with yours & it works.
    Never Leave it until you did it.
    Every time you fails go for one more time :)



  5. #5
    Member level 1
    Points: 413, Level: 4
    Twisted_transistor's Avatar
    Join Date
    Sep 2012
    Posts
    32
    Helped
    2 / 2
    Points
    413
    Level
    4

    Re: Serial Communication using ARM LPC2148

    K.. Thanks alot Jigar:) I'll try it out and let U know..



  6. #6
    Member level 1
    Points: 413, Level: 4
    Twisted_transistor's Avatar
    Join Date
    Sep 2012
    Posts
    32
    Helped
    2 / 2
    Points
    413
    Level
    4

    Re: Serial Communication using ARM LPC2148

    Hey.. Hyperterminal is still blank.. Do you think its because I'm using UART0 as ISP port to program my chip? I use flash magic & use the DTR & RTS to control the RST & ISP pins. So is it possible that my port is stuck in ISP mode & is that the reason why its not functioning as a normal UART?

    I'm really confused..



  7. #7
    Full Member level 5
    Points: 2,342, Level: 11
    Jigar 4 Electronics's Avatar
    Join Date
    Apr 2011
    Location
    Hamilton, ON, Canada
    Posts
    313
    Helped
    40 / 40
    Points
    2,342
    Level
    11
    Blog Entries
    2

    Re: Serial Communication using ARM LPC2148

    In proteus it's displaying the o/p on virtual terminal, So I guess there should not be any problem in code.
    Don't give any delay while using hyperterminal. If you've give any delay then remove it.
    There is no problem whatever you've used to control RST & ISP pins.
    Is it your first attempt in hyperterminal ?
    If yes then do let me know I (& others also) can help to start with hyperterminal.
    Are you getting the proper functioning with uart 1?? (I am asking at hardware & software both side).
    Never Leave it until you did it.
    Every time you fails go for one more time :)



    •   Alt28th October 2012, 12:49

      advertising

        
       

  8. #8
    Member level 1
    Points: 413, Level: 4
    Twisted_transistor's Avatar
    Join Date
    Sep 2012
    Posts
    32
    Helped
    2 / 2
    Points
    413
    Level
    4

    Re: Serial Communication using ARM LPC2148

    Yea.. this is the first time I'm using hyperterminal. Everything functions properly using UART1(hardware & software). I get the correct output on hyperterminal using UART1.


    1 members found this post helpful.

--[[ ]]--