Displaying both line plots and text to a monitor (VGA or Composite TV? Or Other?)
Mahonroy
Posts: 175
in Propeller 1
Hey guys,
I am wanting to use the propeller to display some information to a monitor (line plots and text). I have been playing around with misc. VGA libraries and they seem to be pretty limited on what they can do?
I stumbled across some topics of people claiming to be able to do this, but the topic seems to be outdated and the library is no longer there. I am pretty new to messing with VGA, but it seems you can either do all text, or all plotting, but not both? Also, I came across the graphics_demo in the library, but I was not able to get this to work with VGA, am I missing something?
Is VGA the best rout or should I be using composite TV? I have accomplished similar things with 4D systems displays but they are pretty expensive... so figured if I could accomplish something similar with the VGA or TV then that would be good. Thanks and any help is greatly appreciated!
I am wanting to use the propeller to display some information to a monitor (line plots and text). I have been playing around with misc. VGA libraries and they seem to be pretty limited on what they can do?
I stumbled across some topics of people claiming to be able to do this, but the topic seems to be outdated and the library is no longer there. I am pretty new to messing with VGA, but it seems you can either do all text, or all plotting, but not both? Also, I came across the graphics_demo in the library, but I was not able to get this to work with VGA, am I missing something?
Is VGA the best rout or should I be using composite TV? I have accomplished similar things with 4D systems displays but they are pretty expensive... so figured if I could accomplish something similar with the VGA or TV then that would be good. Thanks and any help is greatly appreciated!
Comments
The first attachment is an example (that hopefully works) that I wrote almost two years ago. It's pretty messy. It uses the regular old VGA.spin. It should be pretty easy to get it to work with vga_1280x1024_tile_driver_with_cursor.spin or vga_1024x768_tile_driver_with_cursor.spin.
The magic part is this:
Where minx, maxx, miny, and maxy are the left, right, top, and bottom bounds (in tiles from the top left) of your plot, gr_y_tiles is how wide the plot is in tiles ( = maxy - miny + 1), and vga_hc is how wide the screen is in tiles.
The second attachment is a completely untested (but compileable) program that should output a 1280x1024 signal with both graphics and text. It uses 3 cogs for VGA and 1 for graphics, though, leaving only 4 for the rest of your application. Since I didn't test it, there might be some off-by-one errors causing the graphics zone to wrap around the screen or something, but hopefully it works well enough for you to understand the basic principle.
EDIT: Peter Jakacki does it again with his Tachyon Forth...
But my method lets you have up to 64 different sets of 4 color palletes that can be assigned individually to each 16x16 tile, and truly combines text and graphics, and doesn't just draw text onto a graphics buffer (which uses less RAM than making everything graphics, like PJ's second example), and doesn't just do ASCII art.
You could also look at FTDI Eve parts (Direct LCD, not VGA)
VGA Text only is common. because that covers many applications, and it needs less system memory.
The P1 only has 32K of system memory, which is light for VGA.
What sort of lines do you need to plot, to what resolution and colours ?
How much Text do you need at the same time ?
I've seen Bar graphs used to give analog style information and they can pack better than poly-lines.
Top end VGA operation can be done with devices like SSD1963, which has > 1MB display buffer on-chip.
Except the great thing about the Propeller is that you can do this, albeit at a possibly lower resolution, all in one chip.
Good point about bar graphs. With a tile driver, you could make 16 different bar graph tiles, for different fill levels, and fill the bar chart appropriately with them.
I've had this plan that I've been wanting to try for a long time for drawing mostly empty plots. Initially, the plot area would be initialized to all point to the same empty tile, and a modified graphics.spin would automatically allocate tiles as they were drawn on. This would allow you to get bigger graphs, as long as they're sparse enough.
I've looked at a mid-ground solution of external SPI SRAM, (Prop does all the timing) where Microchip and OnSemi have Quad SPI 1MB in TSSOP8, and a couple of topologies seem possible.
Two QSPI parts, as either 4 bpp or 8bpp, and 4bpp with a HC257 offers a gain in write bandwidth. (8bpp limits write windows to blanking times.)
One issue here, is both vendors parts specs to a frustrating 20MHz, at 2.5V~5.5V, this hints that 25-30MHz is ok at 3.3V, but it would be nice if they spec'd that !
This gives full raster RAM, so any mix of Characters and lines is possible. No tile caveats.
I did not see an attachment, did you forget to upload it? Also, I found a 1280x1024 tile driver, and a 1600x1200 tile driver.... but could not find a 1024x768 tile driver.
I am shooting for the top 2/3 of the screen to be text, and the bottom 1/3 of the screen to be a plotted graph. I suppose the graph resolution would be good enough at 640x480 (or in this case 640x160). I need to be able to update specific points on the graph is the thing.
Sorry about that...
About the 1024x768 driver: From digging around my Propeller libraries, it would seem that Rayman wrote it. Its tile format is a bit different. For most other prop VGA tile drivers, the tile format is (color >> 6) | (tileptr << 10), but for this one it would seem to be (color & $3F) | (tileptr & $FFC0). That would mean that the graphics zone loop should be (only the last line changed):
I have attached the two Spin files I tried to attach above, as well as the 1024x768 driver (which uses 2 cogs with no cursor).
Another approach : The P1 can time to 1 Sysclk, so you could do 160 lines of single-dot or Bar graph (ie vertical chart recorder like) with higher than 640 X precision, Monitor limited.
Each Dot would have a minimum width set by SW delays.
If you used VGA.spin, you'd be stuck with about only 640x480 total resolution (for both graphics and text), but would be able to use most of it for graphics since the screen would be smaller.
http://forums.parallax.com/discussion/106118
I have been playing around with this trying to understand how its working... and I apologize for my ignorance... but how do you change text colors? (Or text background color - basically inverse the text/background) Every attempt I have tried using the print function for a color select and I get a bunch of jumbled characters on the screen.