c# code for interface between xbee meridian p micro controller devel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sagar45
    New Member
    • Mar 2010
    • 9

    c# code for interface between xbee meridian p micro controller devel

    Does anyone have C# code for interface between xbee and meridian p micro controller development board?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    I've used similar boards... They showed up as COM port devices. You would issue commands to the serial port (or virtual COM port in the case of USB)

    Is yours similar? How to it connect? What does it look like to the PC?

    Comment

    • sagar45
      New Member
      • Mar 2010
      • 9

      #3
      thanks for the reply ..i am making a wireless datalogger ...with a microcntroller as meridian p development and other to xbee modules .....i need to interface between the controller and xbee module....i have got the idea of both the pins ,,.but can't really make ....plzzz help me out ..


      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        I'd be happy to help.
        Please answer the questions I asked you. How does it connect to your PC?

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          I just looked at the link you provided.
          It is a complete step-by-step of creating a new Visual Studio project, adding the right frameworks, files and so on. It even has sample code to work the controller.

          So what's the problem? I mean it really doesn't get much better spelled out that what this board maker provided.

          Comment

          • sagar45
            New Member
            • Mar 2010
            • 9

            #6
            Thanks for ur reply....the main problem is the circuit diagrams connection which i think so ...so if u culd help in the circuit connection with meridian CPU and xbee modules .that would be really help full...please help me ..i am starter


            Thank U

            Comment

            • sagar45
              New Member
              • Mar 2010
              • 9

              #7
              i connect the meridian with USB cable ...using visual C# and SDK

              Comment

              • tlhintoq
                Recognized Expert Specialist
                • Mar 2008
                • 3532

                #8
                i connect the meridian with USB cable ...using visual C# and SDK
                Ok. And the developer gives an entire tutorial and examples in C# for using it.

                Specifically: What are you having trouble with?

                Comment

                • sagar45
                  New Member
                  • Mar 2010
                  • 9

                  #9
                  i need to send the data from meridian cpu to xbee ...how can i do that .....i need to write down the code for.

                  Comment

                  • tlhintoq
                    Recognized Expert Specialist
                    • Mar 2008
                    • 3532

                    #10
                    Please post the code you have written for doing this. And describe where you are having issues. The developer has provided a great deal of sample code for the board he developed. You should easily be able to work from that.

                    Please show us what you have done so far and what SPECIFIC problem you are having.

                    Have you written the developer?

                    Comment

                    • sagar45
                      New Member
                      • Mar 2010
                      • 9

                      #11
                      Code:
                      using System;
                      using System.Threading;
                      using Microsoft.SPOT.Hardware;
                      using DeviceSolutions.SPOT.Hardware;
                      
                      namespace GpioOutputPortSample
                      {
                          public class Program
                          {
                              public static void Main()
                              {
                                  OutputPort outputPort = new OutputPort(MeridianP.Pins.GPIO9, true);
                                  while (true)
                      
                                     // outputPort.Write = (true);
                      
                                  {
                                      Thread.Sleep(500);
                                      outputPort.Write(!outputPort.Read()); //toggle port
                                  }
                              }
                          }
                      }
                      i need to glow the GPIO pin 9 ...i have done all the connection but how can i debug the program and make the led glow ...

                      thanks
                      sagar
                      Last edited by tlhintoq; Apr 13 '10, 03:48 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]

                      Comment

                      • tlhintoq
                        Recognized Expert Specialist
                        • Mar 2008
                        • 3532

                        #12
                        TIP: When you first created your question you were asked to wrap your code with [code] tags.
                        [imgnothumb]http://files.me.com/tlhintoq/10jihf[/imgnothumb]
                        It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

                        Comment

                        • tlhintoq
                          Recognized Expert Specialist
                          • Mar 2008
                          • 3532

                          #13
                          Developer page shows: MeridianP.Pins. LED
                          You are using: MeridianP.Pins. GPIO9
                          So one possibility is that GPIO9 is not designed to run an LED. It might be meant for communication not the voltage levels required of your LED.

                          Have you done the project the way the developer designed first, to make sure you have a proper understanding of it?

                          The developer did not try to flash the LED based on reading it's value, like you are trying. How about giving it a shot the way the developer did it before trying to get fancy?

                          Code:
                          //Thread.Sleep(500);
                          //outputPort.Write(!outputPort.Read()); //toggle port
                          outputPort.Write(true);
                          Thread.Sleep(500);
                          outputPort.Write(false);
                          Thread.Sleep(500);
                          The best advice I can give is to first do the project the way the developer designed it. Then start making modifications and experiments to push the limits of its capabilities.

                          Comment

                          • sagar45
                            New Member
                            • Mar 2010
                            • 9

                            #14
                            Hey thanks for the reply ....i would really present myself in a good way ....

                            the problem regarding my project is that i am writing my code for sending hello message in the controller for xbee ....i have another xbee module connected to the CPU(where this two modules can talk to each other by Xtcu software).when i write the code and debug i have problem get the out put ....i am using usb connection for the controller(meri dian P).

                            Code:
                            using System;
                            using System.IO.Ports;
                            using Microsoft.SPOT;
                            using Microsoft.SPOT.Hardware;
                            using System.Threading;
                            namespace SerialPortWriteSample
                            {
                            public class Program
                            {
                            public static void Main()
                            {
                                 SerialPort serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.None);
                                 byte[] outBuffer = System.Text.Encoding.UTF8.GetBytes("Hello World!\r\n");
                                 serialPort.Write(outBuffer, 0, outBuffer.Length);
                            
                                 serialPort.Dispose();
                                 Thread.Sleep(Timeout.Infinite);
                            }
                            }
                            }
                            could u correct the code ...but this show no error when when i debug but an unhandle exception of system.argument Exception coored in microsoft.soft. hardware.serial port.dll..this the msg is cooming out ...

                            Thank you
                            sagar
                            Last edited by tlhintoq; Apr 15 '10, 12:59 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]

                            Comment

                            • tlhintoq
                              Recognized Expert Specialist
                              • Mar 2008
                              • 3532

                              #15
                              TIP: When you first created your question you were asked to wrap your code with [code] tags.
                              [imgnothumb]http://files.me.com/tlhintoq/10jihf[/imgnothumb]
                              It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

                              Comment

                              Working...