VT100 terminal plugin for the GEAR emulator
Marc Gebauer
Posts: 60
I have been getting familiar with the Gear Emulator; very nice. I wanted to know if anyone has made a VT00 terminal plugin for Gear. It seems that this would be a much faster way of displaying text rather than sending text to the vgamonitor or television plugin. If one does not already exsist, I am interested in giving it a try. But... I don't know where to start. I have written assembly language serial rx and tx routines, and they work so I'd say I have a fair knowledge of asynchronous serial. I have some knowledge of C, have not played with C#, and I have not written anything with a GUI except in VB. So far I have been trying to add a text label or textbox to my plugin but no luck.
10/07/08 - Uploaded Terminal.xml.
The serial UART reciever works reliably up to 230400 BAUD, maybe faster with a non-standard baudrate.
The serial UART transmitter works reliably up to 115200 BAUD and 160000 non-standard BUAD.
(tests were done with FullDuplexSerial driver)
The Terminal screen Word Wraps and Scrolls text and supports the following VT-100 control codes:
Carriage Return, Linefeed, Backspace, Tab,
Clear Screen, Clear Screen from cursor down, Clear Screen from cursor up,
Clear entire Line, Clear Line from cursor right, Clear Line from cursor left,
Home cursor, Move cursor to screen location (row, column).
The text entry box supports sending text and hex values. A hex value is sent by using the format $nn. For example $0d sends a carriage return. If you want to send a $ the use $$.
10/17/08 -·Gear's R & S action keys now blocked while using Terminal Text entry box. Thanks Mirror. Terminal.xml requires Gear V08_10_16 or later http://forums.parallax.com/showthread.php?p=701256
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 10/17/2008 3:50:13 PM GMT
10/07/08 - Uploaded Terminal.xml.
The serial UART reciever works reliably up to 230400 BAUD, maybe faster with a non-standard baudrate.
The serial UART transmitter works reliably up to 115200 BAUD and 160000 non-standard BUAD.
(tests were done with FullDuplexSerial driver)
The Terminal screen Word Wraps and Scrolls text and supports the following VT-100 control codes:
Carriage Return, Linefeed, Backspace, Tab,
Clear Screen, Clear Screen from cursor down, Clear Screen from cursor up,
Clear entire Line, Clear Line from cursor right, Clear Line from cursor left,
Home cursor, Move cursor to screen location (row, column).
The text entry box supports sending text and hex values. A hex value is sent by using the format $nn. For example $0d sends a carriage return. If you want to send a $ the use $$.
10/17/08 -·Gear's R & S action keys now blocked while using Terminal Text entry box. Thanks Mirror. Terminal.xml requires Gear V08_10_16 or later http://forums.parallax.com/showthread.php?p=701256
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 10/17/2008 3:50:13 PM GMT
Comments
The existing plugins would give you an idea of how to write a terminal emulator. The VGA plugin shows how to get transitions and the time at which they occur, and the stimulus plugin shows how to generate signals at specific times.
The VT100 plugin would then do bit-bash transmit and receive, displaying the results to an output window.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks for your input.
I figured I would get what I needed from the vgamonitor and stimulus plugin·concerning the·exchanging pulses. I'm a little unsure how I would determine the bit period, coming from gear, for· instance 9600 baud. Is there a way to·determine what gear's clock is running at and scale·it from there?
Also, I need a primer on how to output to a window and input from the keyboard. Do you have a suggestion on what I would google or any examples that relate to the plugin envirement? Just to be clear; the plugin is written in C#?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
So baud rate to seconds per bit conversion is simply an inverse.
eg: BitPeriod = 1 / BaudRate;
User interface stuff is a little painful. I used Microsoft Visual Studio to create a form, and then copied and modified the code into the stimulus plugin.
I would suggest as a user interface that you *NOT* try and respond to key presses. Instead·make something like a·single line edit which shows the characters that are·due to be sent. Remember that everything happens *MUCH* slower than in real life. You could even get the single line edit to recognise sequences like '$0d$0a' for a linefeed, carriage return and $$ if you need a $ symbol. That way you have a simple mechanism for sending hexadecimal values.
I thing I have what I need. For now...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have started calling my plugin Terminal.xml. Currently my UART receiver is working up to 230400 baud from the spin test application using the fullduplexserial driver. Charcters are showing up in the window of the Terminal plugin. Yay!
I am currently working on adding some·limted ansi screen control codes.
Mirror -·do you know the best way to determine the·spin app's clkfreq (500000 ~ 80000000)·so it won't have to be manually edited in Terminal plugin?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 9/19/2008 6:32:37 PM GMT
To answer your question:
As long as you have the following in your code:
Then the frequency at which the Propeller is running is:
Thanks. That worked!
So currently the Terminal plugin receive·config options are·BAUD rate, receive pin, and invert receive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 9/20/2008 7:49:53 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
I'm sure you'll find the transmitter is a cakewalk once you get to it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have been·away on a job·and sick, but I am back on the project. I have decided to upload Terminal.xml for your evaluation along with Serial_test.spin to show off what it can do. I have·implemented:·a serial receive UART that I have tested with fullduplexserial up to 230400 BAUD and a text·terminal with clear screen,·screen row/col addressing (works a little·unpredictably do to·the plugin's label control word wrap function), and screen scroll. All in all it seems to be pretty bullet proof.·Any suggestions as to how to·make screen row/col addressing reliable are welcome.
Now on to serial·transmit - I have·been studying the stimulus.xml plugin and see that·it was originally slated to have serial transmit functionality.·Since·that makes alot of sense and alot of the structure I need is already there, I am going to·try and add·the functionality.
·***·Placed attachment·in·top post ***
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 9/26/2008 3:27:02 AM GMT
Thanks Very Much
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
I have one question to You.
You have learned Script on Gear.
My question is... Can You write I2C emulator based on same Text file principle that in VT Terminal.
In that File I wil place "00110101 110101010" and so on.
In first Text Line I will place PIN pair (maybe I2C speed) and then in next line data to send.
Blanks betwen data MARK not sending pause.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
1) Transmit chars/strings using stimulus.xml.
2) Allow VT100.xml (or whatever you called it) to do transmit as well as receive, for making interactive testing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It would not be too difficult to write a convertor to get from I2C to the current stimulus file format.
A problem not covered in you theoretical implmentation is start condition and stop condition generation, and more importantly ack states for each of the bytes sent.
The stimulus file format is flexible enough to allow any incoming protocol to be simulated. It allows allows pins to be tristated.
Treating the Propeller as an I2C slave device is probably not as useful as making some external plugins that are I2C compatable (for example an EEPROM plugin).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I intend on finishing this project then I'm not sure about the next one. Maybe if you told me more about what your trying to accomplish, I might get interested. Do you want to emulate a partiucular i2c device like an eeprom?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It was only basic idea.¨I have not detalied all.
I know it must be more specified but if we hepls any other maybe it is posible.
It was one idea to VT Terminal to. Have in first Text Line PINs to use on Serial comunication in that way pople must not edit Script file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
OK, I'll concentrate on making Terminal.xml interactive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Most I/O ICs with not to many data from (type RTC, I/O expanders etc..)
Ps.. I am sure that You have to Use of that posiblity. For tests it is only TEXT to PINs that is nesesary. It is mostly if one program wait for data from that device.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Post Edited (Sapieha) : 9/25/2008 9:48:17 PM GMT
I have started the tx side of things and ran into a confict. Is there a way to block the r & s·keys from gear·while I am entering text into a textbox in·the Terminal plugin?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Send me your almost working code - except for r and s keys, and I'll fix GEAR to allow those keys·for all plugins. Otherwise I've got to write my own test plugin . . .
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 9/26/2008 3:31:13 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Marc Gebauer) : 10/8/2008 2:41:41 PM GMT
Fantastic.
I have one question to You and Mirror.
How much work with Gear it is to have Real Emulator.
My think is....
Have one DLL to conect to Pararell Port on PC and one Plugin in Gear.
Thanks for Termonal plugin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Sorry but I can't help you I do not know about writing emulators and I was not involved in programming the Gear emulator.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It was only mt think on that idea.
Have any Parallel interface to Gear. Gear has with plugins has all mechanisms to it.
I know that it is not You that write Gear.
Only problem is to write Parallel interface DLL that can conect to Parallel port maybe Serial to.
That construction give posiblites to test all on bredboard from Gerar without have propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yes maybe limited but in EPP mode Parallel Potrt in PC is bidirectional + You have outgoing signasls on status port to.
Modern Parallel ports have 3 modes and 2 of them is bidirectional.
Ps Parallel port is often used as IC2 bus in many programing tools for micros type PIC and others.
Parallel ports are also posible with USB to Parallel converters.
FTDI has that chip USB to 2 Parallel else 1 + Serial else 2 serial in same chip and that chip has even posiblites to emulate BUS On Intel 8085 CPU else Motorola CPUs
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Post Edited (Sapieha) : 10/9/2008 1:26:38 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔