In all my embedded DSP based products I use an RS232 port (driven with printf) as a means of seeing whats going on inside a CPU or DSP.
I am looking for a way to increase the flexability of the displayed data since there is often data from differnt processes all competing for my attention before it scrolls off the screen.
I was considering using an X Windows terminal emulator program (which I know very little about at this point) as a means for interacting with my embedded projects. It would be great if I could fire up an Xwindows terminal emulator program on my Windows PC, choose COM2,
19200 8N1 and BAM! display graphical data from a small embedded device. Since the available memory left over for debug-related code tends to be on the order of a few kbytes, the embedded device would only be sending printfs containing the most basic of Xwindows commands.
Has anyone done something similar to this? Is there a better way to get a tiny embedded device to control a standardized graphical debug interface?
What? It isn't at all clear what you mean by "fire up an X Windows terminal emulator program on my Widnows PC". You want to run an Xterm and have it run and display on your windows machine or run on your Windows machine and display elsewhere?
Huh? X Windows terminal emulators don't typically do graphics (unless you count xterm's Tektronix 4xxx emulation). They're just text terminals.
You seem to be laboring under a fundamental misunderstanding of what a X Windows terminal emulator does. It's typically just a ANSI terminal emulator that runs under X Windows. It doesn't do graphical X protocol stuff via the serial port.
X Windows terminal emulators aren't graphical (except for xterm's emulation of an old Tektronix storage-tube terminal).
Grant Edwards grante Yow! My pants just went to
at high school in the Carlsbad
That may explain my confusion when trying to Google for info on this concept.
Back in the late 1980's to early 1990's when Unix work stations transitionsed from text-based to graphical interfaces (at least thats when I saw it happening in college), I was under the impression that the graphical user interface was based on a stream of ASCII commands similar to PostScript. Maybie it WAS postscript... But at any rate these graphical dumb terminals were communicating over a network using a human-readable ASCII protocol (similar to the concept of HTML but much more user readable).
Was I on drugs or was there some GUI interface that used an ASCII serial stream at its lowest level (not HTML but similar in concept)?
You're probably thinking of Display Postscript, not X.
Still, it sounds like you need something more like syslog than X or DP. All that means is that each printf() gets an extra parameter or two that says where the message is coming from, and it's "level" (verbosity, severity, whatever). You store all the messages on the development machine, and you can filter them later.
You'd need to design a simple encapsulation protocol, but that shouldn't be hard. A few bytes for a header with type/size, then many bytes for the message.
You may be thinking of "display postscript", a scheme unrelated to X Windows that Sun used in it's first foray into GUIs.
Or you might be thinking of AT&T's MGR windowing system: it was based on in-band escape sequences.
MGR was a cute little system. I had it running under a Unix v7 clone on an 80286 for a while. It didn't require any networking facilities at all -- everything was done in-band via ptys. The X protocol is binary and runs over either TCP or Unix domain sockets. You could establish a PPP connection and then send X protocol commands from the embedded system to an X server running on the host (under Windows or Unix).
That sounds like either MGR or Display Postscript to me (though I know little about the latter). The X protocol is a pretty complex binary protocol that runs over network connections.
Grant Edwards grante Yow! I want to so HAPPY,
at the VEINS in my neck STAND
I was hoping there was a standard terminal emulator protocol (like a graphical version of a VT100 terminal) that would allow me to place a few buttons, graphs, and text windows on the PC's screen and maybe even accept user input commands like button press events and keyboard input - over a low bitrate serial stream.
I guess those were actually TEK terminal graphics command streams or similar.
But serious confusion of terms is reigning here. There are various different things called "terminals". So I guess it's time for a little excursion to history.
First, there were relatively dumb keyboard+screen devices that served as mere human interfaces devices to a central multi-user computer, typically on a point-to-point serial line. Since they were at the endpoint of a long-ish cable, it was only fitting that they ended up being called "terminals". The canonical example is DEC's VT100. Some of these terminals were enhanced with graphical vector-drawing capabilities as a separate mode of operation (e.g. the TEK4010). I've never seen it done, but some people certainly must have used this to implement early GUIs, although it poses quite an amount of stress on the host computer.
Then came the next major step: The X Window System, a.k.a. X11. The key differences are that more intelligence was shifted to the terminal end of the chain to reduce load on the host, and the point-to-point connection was replaced by general-purpose networking. Thus the "X terminal" was born: a special-purpose user-interface computer running the "X Server". X11-enabled "client" programs can be started on any computer and have their user interface on any X server on the network. The X terminal also implements protocols to start such client sessions on remote machines. When you hear buzzwords like "thin client" or "network computer", it helps to think "X Terminal"
Gradually the roles of X terminal and "main computer" merged, and the result was the Unix/X11 workstation, most of which these days are Linux PCs.
Now, just about the most important X11 client programs is XTerm, the "X Windows Terminal emulator". Now hold on to your hat for the explanation of what it does: XTerm emulates an old-style dumb terminal in an X11 window to show up on an X Terminal. In other words, it's a virtual VT100 that runs on a "real" computer, and provides the user interface to a command-line program inside a window. In particular, it's not an emulator of an X terminal, but a terminal emulator that is an X client.
And then of course there's the kind of "terminal program" you're really looking for: a serial communications program. That's the kind of program you would run to connect to a RS232 device and display its output. The canonical one used to be Kermit, with minicom a close second.
I use AT&T's FMLI (the source is now available in OpenSolaris) on a variety of projects to build curses-based GUIs -- graphs are only possible using characters from the extended set but it would do what you suggest. I have a demo "ascii oscilloscope" program written in C for the i8096 on my site and also a GUI running on the 'zipit' based on FMLI if your interested.
OK, I guess was some what mis-informed from the beginning. I asked the original question half assuming someone would say, "sure you can do it that way, but here is the way every one else is doing it...".
I remember seeing an ad for a LCD touch screen that had a GUI scripting language built into it. Maybe I will see if they are still in business. Otherwise I might have to roll my own (or pay someone else to do it for me).