Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Serial communication - FTDI port and XBEE port

  1. Serial communication - FTDI port and XBEE port

    Hi all,

    I am currently working on a three joint robotic arm with MX64T,MX28T and AX12A used for joint 1, 2 and 3 respectively. I am using the Arbotix-M Robocontroller to control them.

    I am using the RX and TX line in the FTDI pins to communicate with a mbed which controls a mobile platform. I wanted to use a XBEE module on the Arbotix to communicate with a LabVIEW interface in my PC to return the angles of the each of the servo to a 3D simulation model of the robotic arm. But I am not sure if I can use the FTDI and XBEE port at the same time. I have read somewhere that they use the same serial port and therefore it may not be possible. I wanted to confirm if this is true. Also, I wanted to ask if there is any way around it to achieve my desired tasks.


    Any help will be greatly appreciated. Thanks.

  2. #2
    Join Date
    Jul 2014
    Location
    New Zealand
    Posts
    70
    Images
    3
    Rep Power
    19

    Re: Serial communication - FTDI port and XBEE port

    Hi
    You're correct that the serial port is shared, see note on the Arbotix-M site "NOTE-The FTDI port and the XBee socket share a serial port, so only one can be used at a time. To program the ArbotiX while an XBee is connected, you must use an ISP programmer"

    I had a similar challenge, but with communication to a Raspberry Pi, and tried two different approaches - both of which worked OK.
    The first was to communicate using I2C, leaving the serial port free, the second was to move the XBee to the RPi using a USB adapter.

  3. #3

    Re: Serial communication - FTDI port and XBEE port

    How much data are you using to communicate with the mbed? If it's not a huge amount of data, you might be able to use software serial to communicate with it, leaving the hardware serial free to interface with the xbee

  4. Re: Serial communication - FTDI port and XBEE port

    Quote Originally Posted by kgranat View Post
    How much data are you using to communicate with the mbed? If it's not a huge amount of data, you might be able to use software serial to communicate with it, leaving the hardware serial free to interface with the xbee
    The mbed is used to control a mobile platform/buggy that the robotic arm is mounted on. The robotic arm is controlled by the Arbotix-M Robocontroller.

    Currently, the communication for the mbed are as follows -

    1. The mbed sends 5 ASCII characters, for example: 155TC
    2. The Arbotix sends a single acknowledge ASCII character, for example: Y

    So, the current data exchange is definitely quite small. But I am a bit confused on the hardware and software serial. How do you configure them differently? And is the physical connection different then to the mbed? Currently, I am using the RX and TX lines on the FTDI header to communicate with the mbed.


    Any help will be highly appreciated. Thanks.

  5. #5

    Re: Serial communication - FTDI port and XBEE port

    Hardware serial, uses the underlying UART support of the processor to to the work, which in the case of the Arbotix there are two of them. One of them is used to talk to the AX/MX servos. The second one is used to talk either to FTDI, or XBee.

    So if you need additional serial communications from your Arbotix to something, there is a library SoftwareSerial, which allows you to use two general purpose IO pins to emulate a UART through software. If I remember correctly with the Arbotix you can use most any IO pin for the RX and TX. On some Arduinos like megas you are limited on which pin you can use for RX due to the library relies the pin change Interrupt, which on some processors not all pins support this.

    The downsides to Software Serial is, it is all done in software including the timings of the IO pins. So it eats up processor time and the IO can be less reliable especially if the processor is having to handle interrupts from other devices. This is especially true at higher baud rates.

    But if your IO requirements are not high you should give it a try.

    The mbed does not need to know if it is talking to hardware or software, as long as you configure things correctly. This is they both are using the same baud rate, parity...

    Kurt

  6. Re: Serial communication - FTDI port and XBEE port

    Quote Originally Posted by KurtEck View Post
    Hardware serial, uses the underlying UART support of the processor to to the work, which in the case of the Arbotix there are two of them. One of them is used to talk to the AX/MX servos. The second one is used to talk either to FTDI, or XBee.

    So if you need additional serial communications from your Arbotix to something, there is a library SoftwareSerial, which allows you to use two general purpose IO pins to emulate a UART through software. If I remember correctly with the Arbotix you can use most any IO pin for the RX and TX. On some Arduinos like megas you are limited on which pin you can use for RX due to the library relies the pin change Interrupt, which on some processors not all pins support this.

    The downsides to Software Serial is, it is all done in software including the timings of the IO pins. So it eats up processor time and the IO can be less reliable especially if the processor is having to handle interrupts from other devices. This is especially true at higher baud rates.

    But if your IO requirements are not high you should give it a try.

    The mbed does not need to know if it is talking to hardware or software, as long as you configure things correctly. This is they both are using the same baud rate, parity...

    Kurt
    Thank you for the information. I will definitely test that out then.

    Is it possible for you to provide a link of any example of using SoftwareSerial that may be similar to what I am trying to achieve please? Thanks.

  7. #7

    Re: Serial communication - FTDI port and XBEE port

    You could also use I2C or SPI for communication; these are generally free, and not much harder than serial ports.
    SPI is a simpler protocol, but tying something else to SPI may interfere with trying to program the Arbotix using a USB programmer.
    I2C is all-around robust and useful, once you get the hang of it.

  8. #8

    Re: Serial communication - FTDI port and XBEE port

    Quote Originally Posted by navidahmeduom View Post
    Thank you for the information. I will definitely test that out then.

    Is it possible for you to provide a link of any example of using SoftwareSerial that may be similar to what I am trying to achieve please? Thanks.
    Have you looked at the example(s) for softwareserial?

    Open up Arduino IDE, go to File menu, choose the Examples menu item, browse through it until you see SoftwareSerial and then choose an example...

  9. #9
    Join Date
    Jul 2014
    Location
    New Zealand
    Posts
    70
    Images
    3
    Rep Power
    19

    Re: Serial communication - FTDI port and XBEE port

    Here's a link I found useful when setting up I2C if you want give I2C a go too. Especially useful if you want to connect more than one device.

    http://blog.oscarliang.net/raspberry...connected-i2c/

  10. Re: Serial communication - FTDI port and XBEE port

    Thank you for the information. I have tried testing Software Serial using the Arduino Uno and Arbotix-M and it did work. But one of the problem I am facing is in extracting more than one character.

    For example, for testing the Software Serial comms, I only sent one character, 'A', from the Arduino Uno to light up a LED on the Arbotix-M.

    For my system, I need to read five ASCII characters from the mbed, for example: 155TC , from where I need to extract the first three characters for distance measurements and the next two characters for dictating the motion for the arm.

    Currently, on the hardware serial, I have been using-

    Serial.readBytes(buffer, 8);

    for reading incoming data from the mbed. I read the individual bytes from the buffer to extract the required information.

    I was wondering if I can do something similar with the Software Serial? Can I read all the characters from a buffer and extract the information that I need to?

    Any help will be greatly appreciated. Thanks.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. how to read from serial port
    By KAYSHEHU in forum Project Showcase
    Replies: 2
    Last Post: 08-09-2012, 05:03 AM
  2. Question(s) FTDI FT232R - impossible to open port
    By Pocar19 in forum Software and Programming
    Replies: 0
    Last Post: 05-30-2012, 05:26 AM
  3. Question(s) where in the Arbotix AVR code is it talking to the XBEE serial port?
    By stephen.hazel in forum Arbotix, Microcontrollers, Arduino
    Replies: 5
    Last Post: 05-04-2012, 12:21 PM
  4. Serial Port in VBScript
    By Judge in forum Software and Programming
    Replies: 11
    Last Post: 01-04-2010, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •