Fourth Serial Device Needed, Feasible Options?

03 Apr 2011

I really need to connect four serial devices to my mbed project the devices are:

CH Robotics UM6 IMU/AHRS, RFM DNT900P 1 WATT RF Modem, GM862-GPS Cellular/GPS module, (1 serial port for the GSM modem commands and 1 serial port for the GPS).

Note: I have the option of getting the GPS data from the GSM modem serial port, but I will have to have the program ask for it every second. I would much rather be able to connect to the dedicated GPS serial port that automatically streams the GPS data. Also, I have the option of using the GM862-GPS internal PYTHON interpreter and programming the GSM modem serial port to output the GPS data every second, but I don't want to have to learn PYTHON and I'm sure I will run into problems along this route.

So basically my question is can I connect the usb serial port on the mbed to a POLOLU usb-serial converter and then to one of my devices listed above? I know that I will have issues with the host/slave part of this.

Also, is it possible to use the mbed (real) USB host on my coolcomponents board to connect to my POLOLU usb-serial converter without having to write FTDI drivers on the mbed?

Thanks in advance, I know I'm missing something that's probably obvious.

03 Apr 2011

Oh yea, CH Robotics has been in the process of adding SPI output support for the last few months but it's still not released. If that were the case then I would be able to put the UM6 on one of the SPI's, use the other SPI for the coolcomponents board sd card, and use the other three UART's for the rest of the devices. Of course I would have to use Andy Kirkham's Alternative Mbed Pinout, which allows for using the three UART's and both SPI's. I really think this alternative pinout should be included in every pinout post along with the standard pinout.

http://mbed.org/media/uploads/AjK/pinout-alternate.png

03 Apr 2011

Import libraryMAX3100

MAX3100, an external serial device to add additional serial ports via SPI

03 Apr 2011

If you have a spare SPI interface you could use an SPI-interfaced UART chip. Take a look at NXP SC16IS7 or Maxim MAX3110E/MAX3111E. The Maxim devices also incorporate RS232 transceivers.

Paul

03 Apr 2011

The MAX3100 library above makes the Maxim series SPI/UART devices appear to your program just like an Mbed Serial object.

03 Apr 2011

Thanks, I really wish I knew about the MAX3100 a month ago since I've already spent alot of time getting a MAX13003 setup on a sparkfun SSOP to DIP Adapter 16-Pin breakout board. I needed the MAX13003 to do the logic level translation from the 2.8v that the gm862-gps uses to the 3.3v that the mbed uses. I know that theoretically 2.8v and 3.3v work together but somehow I broke my first gm862-gps module by having the 3.3v serial hooked up and removing the sim card with the gm862-gps powered off. I checked later and found that the sim card pins have voltage on them when only the serial is hooked up, probably from internal pullups on the serial lines. The MAX13003 solved this problem because it has an enable pin that enables the translation only when the gm862-gps is on. The dead gm862-gps never registers on the network and all serial communication fail because the serial lines are never pulled low, they only go down to about 1.5v when trying to send data.

So looking at the MAX3100 it has many advantages, first is that it comes in a 14 pin dip package. Second, it will work with the gm862-gps 2.8v logic. I'm still confused about the required crystal oscillator. The datasheet states, "The on-board oscillator can use a 1.8432MHz or 3.6864MHz crystal, or it can be driven at X1 with a 45% to 55% duty-cycle square wave."

So do you recommend a crystal for this design, or have you tried driving X1 with the required square wave from the mbed?

03 Apr 2011

It looks like your devices have modest data rates, so you could just bit-bang the fourth serial channel.

IAR has an App Note with source code as a starting point...

03 Apr 2011

When I tested my MAX3100 library I just used a bog standard cheapo 1.8432MHz watch xtal and a couple of caps (27pf iirc). I didn't try and use an output from the Mbed to drive it but that should be possible using the PWM module. And yes, you can bit-bang a serial. Upto you how much you want to spend on a "production unit" as bit-banging will certainly be cheaper in that sense :)

03 Apr 2011

I considered the software uart possibility but my projects an autonomous parafoil vehicle that guides itself down from a weather balloon that takes it up to 100k ft, and the serial communications are really critical for a variety of reasons. I had to take over all the radio communications on this project because another project member got stuck when trying to use the horrible softserial libraries on an arduino. Yea the software serial stuff could work but if they were so great there wouldn't be any such thing as hardware serial ports on microcontrollers.

03 Apr 2011

Alright, ordered from digikey:

  • MAX3100CPD+ IC UART SPI MICROCOMPATBL 14-DIP $8.16
  • ECS-18-13-1 CRYSTAL 1.8432 MHZ $1.95
03 Apr 2011

Cool, if you need a hand with the library give me a shout. But you should find it very simple to use. The examples even show you how to wire up the device. On a side note, I wasn't paying too much attention to the GPS you are using but when you mentioned 100,000feet altitude I thought I'd point out that most standard GPS modules are not certified that that altitude. You might like to check your datasheet on that one, just to make sure. (iirc most GPS module manufactures get nervous at the thought of their hardware making there way into missiles/guided ordanance).

03 Apr 2011

Thanks Andy, I'm sure you'll be hearing from me again. I plan on using your MODGPS library to. Quick question, when I was looking through your MODSERIAL library I remember seeing something about RPC compatibility. I'm using MODSERIAL for the UM6 data reception, and am also using the LabView RPC stuff to be able to control the remote mbed from LabView through the DNT900 RF modems. Will there be any conflicts between LabView RPC, MODSERIAL, MODGPS, and MAX3100 libraries? Man I'm really putting your libraries to work.

I've known about the high altitude GPS issues from the start of the project. What I'm going to attempt is have the mbed reset the gm862-gps at a set period if there's no GPS data output. I've read somewhere that someone is attempting to reflash the SIRF III chipset that is in the gm862-gps module so that it will work at high altitudes and ballistic speeds. I'm a little worried that even googling this subject will put me on the no-fly list. Other balloon projects have attempted to ask roundsolutions about the high altitude shutdown/restart methods needed, but they told us to buy there epoxy encased gps module for 500 euros and to sign a non-disclosure agreement just to read the datasheet.

If anyone is considering buying the gm862-gps module i think it's a great module but telit/roundsolutions has the worst customer support that I have ever experienced. They only recognize you as a official customer if you buy there custom development board for over $400 US dollars. Also, they pretend like they solved your issue in a forum and then lock the forum topic so you can't post again to tell them that your issue still isn't solved.

03 Apr 2011

With regards to MODSERIAL and RPC, I haven't written anything into it for RPC. What I do know is some other people use MODSERIAL in serial RPC projects as it appears to "just make it work" when they have problems using an Mbed Serial object. If you go to the MODSERIAL page and look down the right hand side you'll see someone elses project called BufSerialRPC that uses MODSERIAL as a reliable comms device. I have no knowledge of that project other than it uses my library apparent to "fix things".

I know MODSERIAL, MODGPS and MAX3100 libs will all work happily together :) I wouldn't know about the RPC stuff though. And I'm pleased to here you are using the libs. Please do let me know when our software breaks the 100,000 foot mark, I've never gotten it that high before (afaik) !!

I may be wrong but the issue surrounding high altitude and high velocity is due to the classification as munitions and the usual limitations that brings. I can understand why the manufacturers are keen not to have their products cracked. IED (improvised explosive devices) would be easily turned into IEM (M for missile)! And I have to agree with them on that.

04 Jun 2011

you can copy all GPS data to GSM serial port by AT$GPSNMUN commands, so you will save 1 serial port

Information

$GPSNMUN - Unsolicited NMEA Data Configuration Set command permits to activate an Unsolicited streaming of GPS data (in NMEA format) through the standard GSM serial port and defines which NMEA sentences will be available

Telit AT Commands Reference Guide