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

Interfacing LPC2148 with visual studio

I have development board of LPC2148
can anyone give me an example of UART communication for the same using visual studio 2008.
Since the project is based on image processing I just need to the transfer those values to Embedded kit from visual studio.

So please if anyone has the example of let say "HELLO WORLD" also it would be a gerat help to me.

Parents
  • i have done a small code to send data though serial communication using visual studio..
    i think it may help u...

    below is the code in VB.net

    in this i have used two text boxes and one button
    when we a enter some text in a textbox1 after clicking the butto, the text will be transfer to controller which we have connected to com port

    Public Class Form2
    
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            SerialPort1.Open()        //
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim a As String
    
            SerialPort1.Write("abc")       // transmitting data to controller though serial port
    
            a = SerialPort1.ReadExisting() // receiving data from controller through serial port
    
            TextBox2.Text = a.ToString()   // displaying the data which we received in textbox
        End Sub
    End Class
    

Reply
  • i have done a small code to send data though serial communication using visual studio..
    i think it may help u...

    below is the code in VB.net

    in this i have used two text boxes and one button
    when we a enter some text in a textbox1 after clicking the butto, the text will be transfer to controller which we have connected to com port

    Public Class Form2
    
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            SerialPort1.Open()        //
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim a As String
    
            SerialPort1.Write("abc")       // transmitting data to controller though serial port
    
            a = SerialPort1.ReadExisting() // receiving data from controller through serial port
    
            TextBox2.Text = a.ToString()   // displaying the data which we received in textbox
        End Sub
    End Class
    

Children
  • "the text will be transfer to controller which we have connected to com port"

    Just to re-emphasise that the the PC application neither knows nor cares what is connected to the COM port.

    It makes absolutely no differences whatsoever to the PC application whether that COM port is connected to a terminal, or another PC, or a microcontroller, or anything else...

    Part of the OP's original problem was, probably, due to failing to have this clear.

    Hence it is better not to talk about stuff being sent "to the controller" or received "from the controller" - keep it clear by just saying "to the COM port" and "from the COM port"

  • Can I get a code which does the same thing in visual studio, but uses C languagee.
    Because I would be using openCv library which is used for image processing

  • "Can I get a code which does the same thing in visual studio, but uses C languagee."

    Yes you can. The best way would be to use Google.

  • Can you get it?
    Well, that rather depends on how much effort you're prepared to put into getting it!

    As already noted, using the COM ports on Windows PCs is not an uncommon task, and there is plenty of information to be had about it.

    "but uses C languagee"

    For anything PC these days - including VS - you're far more likely to find C++ than C.
    But that shouldn't really be a problem...

  • "But that shouldn't really be a problem..."

    Absolutely. There are a good collection of functions to communicate via the COM ports within the WinApi - And they are easily accessible via C or C++.