I'm trying to build a connector that converts from the Mote connector on the stargate, to a 2nd stargate serial port.
Folks in the lab have plugged motes directly into stargates and successfully communicated via serial to them (using /dev/tts/1), so I know *something* on there must work. I just can't figure out which pins the serial is using.
Based on the email below, I built a connector that routes pins 19 and 20 on the mote connector to pins 2 and 3 on a DB9 connector... but that didn't seem to work.The Stargate users manual suggests that Pins 27/28, and, pins 16/17, both attach to the Mote's UART, but are just GPIO pins on the stargate side. Does anyone know which pins the mote actually uses for its serial port?
w\What are you connecting the serial cable to -- the other end of the DB9 connetor? What didn't work? If you're trying to send it to a "standard" serial system like a laptop or other computer then you'll likely need a level shifter to get it to work because the voltage levels aren't compatible. I'm not sure about the pin #s myself...
Just FYI -- the SPP is the other serial port that is connected to the Mote connector on Stargate. Using it would free up the other serial port -- and it might have other advantages as well. I believe people tried to use the SSP before but it wasn't working for some reason, so this might be a chance to try again if anybody is interested.
Here a small patch to add support for SSP for a PXA255 processor.http://ftp.enneenne.com/pub/projects/pxa-ssp/patch-pxa-ssp
This patch has been made agaist linux-2.4.19-rmk7-pxa2-ptx14 but it should apply on others Linux version in 2.4 series. This code has been tested with an ADC converter (National Semiconductor ADC78H90).
For a quick initial test, I was trying to hook it up to a PC, although it'll ultimately be hooked up to something else.
Basically, I wired pins 1, 19 and 20 to pins 5, 3, and 2 of a DB 9 connector, then used the DB9 to attach to a PC. No luck after various combinations of tty settings and null modems, etc.
What's the line level of that mote serial port? I guess it's different from the line level on the "main" stargate serial port (console db9 port), then?
STOP NOW! You can be sending 12V from the PC into a 3.3V port on the Stargate.
OK..Here is your solution. Use a MAX3221 IC for your level conversion. It takes a 3.3V supply (which is available on the mote connector) and only requires 5 external caps (all .1uF) It will do all the proper shifting of the voltages for both the PC and Stargate. When connecting to the Stargate, remember that, if you are using the schematics for the 51 pin connector from tinyos.net (and associated labels) they are from the perspective of the microcontroller on the mote. This means that they are backward wrt to the Stargates UART (I say this because I have been bitten by this before :) ). There is a good chance that you haven't done any damage to the Stargate, but it is certainly out of spec to drive the UART of the Stargate from a PC. One more thing, in the last build I played with, the tty for the mote connector is on S2 (the BT module was on S1) Since you won't have any of the flow control lines, make sure to set the port to RAW for communicating (which is how it should be set for the motes anyway)
The easiest test would be to do a quick loopback -- just connect the serial out to serial in. That way, you can make sure you have the right pins, and get the software side of things going, without needing to mess around with the level shifter, since depending on your eventual goal, the level shifter may not be necessary. And it also removes the PC settings as a possible source of mismatch. If you have a scope, it would be invaluable for finding the right pin. (As adam said, pin numbering can be horribly confusing).
Also, I'm just noticing that there is a MUX attached part (U21) that is attached to the serial lines of the mote connector and then some other stuff, which is controlled by GPIO22. I'm not sure offhand what this is for (the serial lines are also connected to the edge conector on the bottom of the board). So, this is something to think about too.
So, does the main console serial port (the db9) on the stargate have one of these MAX3221 ICs on it, then?
Yes it does. It is on the daughter card closest to the DB9 connector. As an aside, the new revision of stargate boards - which Xbow has just started shipping, have the 2 serial ports (other than the console) provided as a 4 pin header (Tx and Rx only) on the edge of the processor board for easy wiring (no messing with Mote connector).
What COM ports are accessible from the Stargate?
Both COM ports are accessible via the mote connector on the daughter card. If you program the GPIO22 to be 0, synchronous serial is available through the GPIO23, GPIO24, GPIO25, GPIO26 and GPIO27, at pins 18,10,16,17 and 18 of the serial/mote connector. We have to make sure that GP24 pin that is currently shown as LED connector is part of the synchronous serial interface. This needs a small tweak in the driver to change the mode of the GPIO24 pin.
The standard UART is available on pins 19 and 20 of the serial/mote connector via the IR pins.
Slight typo.. Look for the changed line GPIO23,GPIO24,.... in the below message.
Do these have level converters on them as well? Or just a different physical connector?
No, they do not have any level converters, just a different routing to a physical connector.
I can't quite tell from the docs (or I'm looking at the wrong docs), but are any of the stargate serial ports more than simple 3-wire ports? In particular I'm wondering if I can get a rising edge of DCD to trigger an interrupt on any of them.
I thikn the only PXA UART that has a functioning DCD is the "Full Feature" uart, which is used for the console. The DCD doesn't even exist on the other ones (this is a function of the PXA, not Stargate). I think you might be able to generate an interrupt off of a CTS/RTS signal on the others -- e.g., the HW/BT UART. Also, if you just want to generate an interrupt any 'ol GPIO pin will work for that.
You're in luck -- it looks like DCD is hooked up to the level converter on the Stargate daughterboard, although it doesn't seem to go anywhere (i.e., you might need to solder directly to the pin).
I wrote a program to control a motor controller via RS232. My program works fine on the linux laptop. However, once I switched to stargate (same program), I was only able to send commands from stargate to motor controller, but not able to receive any responses back. I use read(fd, buffer, length) to listen the serial port.
Tt just occurred to me that the problem is most likely that you are using the same serial port that 'getty' is using for the console login prompt. You should either use another serial port or turn off getty from /etc/inittab. Be warned that turning off getty, though, means you can no longer log in over the console serial port, so make sure ethernet is working first!
Instead of turning off getty, our group uses dual serial-ports pcmcia card. I have tried on Amigobot, and it works.
I am trying to use the J14 edge connector to connect to a GPS unit. Pins 5 and 6 (the UART) are inactive while pins 2 and 4 (IR Port) are acting strangely. Pin 2 transmits data for ttys2, pin 4 should be receive, however, it is tied high and the device can't toggle the signal low.
Essentially, I can send data to the GPS unit to tell it to modify its own status, but I'm unable to receive data back from the unit. Has anyone experienced similar problems when working with serial devices?
I've attached the pin-out for the MUX -- which has all the details!
It basically controlls the functionality of the serial ports for the 51-pin mote conntector. I *think* the one pin you would want to lift would be pin 12 -- which is the output driving the IRRXD line.
Is there is a dial up modem dialer that Has been tested with stargate? There are a couple of dialers available for arm linux. Has anyone tested any dialer?
I've used the 'chat' program sucessfully as a dialer. It was with a GPRS card, but the interface is essentially the same (AT commands). 'chat' is part of the standard stargate build