TEK 4010/4014 Vector Graphics terminal DEMO

Post your cool example code here.
User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by Pito » Mon Jul 17, 2017 3:52 pm

None spec, googling only..
Here is the Fleet consisting of 625 Type 26 frigates, created by

Code: Select all

  Tekcolor(green);
  char* sprite;
  // Type 26 frigate
  sprite = "PAAAAAAAAAAAAAADDBBBDDBBBHHBBBDDBBBHHBBHH";
  elapsed = micros();
  for(i=100; i<600; i=i+20){
    for(a=100; a<600; a=a+20){
      Teklocate(i, a);
      Teksprite(sprite);
    }
  }
  elapsed = micros() - elapsed;
  Tekalpha();
  Tekfont(normal);
  Teklocate(100, 50);
  Serial.print("Elapsed: ");
  Serial.print(elapsed);
  Serial.println(" micros");
Royal Navy.JPG
Royal Navy.JPG (114.36 KiB) Viewed 230 times
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by Pito » Sat Jul 22, 2017 9:12 am

As a proof of concept I've tried with the Tek terminal as a screen of a diy Spectrum Analyser (1024 point CMSIS fp FFT).
Fed by my old dyi siggen into the 12bit ADC (Black F407ZE), the ADC input centered by 2x 10k resistors and coupled to the siggen via 100uF cap (all put on a solder-less breadboard, long wires, +Vref is the Black's Vdd), and the video-streaming done via SerialUSB into the Tek Terminal (TeraTerm Win7).
The Tek terminal is perfectly usable, the Tekcls() and Serial.printing of numbers causes a short blink sometimes, but drawing 512 spectra (lines or dots) itself is fast, realtime. Avoiding the Tekcls() and minimizing Serial.printing will do it realtime.
Below a ~30kHz sin signal:
1. signal's generator output level at zero - you may see there is still a signal leakage off the siggen output, however (the noise floor is something like 200uVpeak).
2. with ADC not over-driven
3. with ADC over-driven..
FFT_Siggen_1.JPG
FFT_Siggen_1.JPG (36.85 KiB) Viewed 196 times
FFT_Siggen_2.JPG
FFT_Siggen_2.JPG (40.24 KiB) Viewed 196 times
FFT_Siggen_3.JPG
FFT_Siggen_3.JPG (40.36 KiB) Viewed 196 times
Last edited by Pito on Sat Jul 22, 2017 2:34 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by RogerClark » Sat Jul 22, 2017 10:41 am

Thanks

This could be really useful.

Putting it into a library would IMHO be the next logic step

User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by Pito » Sat Jul 22, 2017 12:19 pm

There are the updated routines in the first post. With defines for colors, fontsizes and line styles.
Still the none_CLS way of updating the screen content has to be elaborated.
My idea is to rewrite the dynamic information on the screen with the previous information but with black ink (with the background color), thus erase it before writing the new one.
Like:

Code: Select all

Tekcolor(green);
Teklocate(200,200);
Serial.print("Hello World");
Tekbox(100,100,700,700);
do_something();
// Delete the above info only, no Tekcls()
Tekcolor(black);
Teklocate(200,200);
Serial.print("Hello World");
Tekbox(100,100,700,700);
// .. deleted from screen
..
Btw, you can open several Tek terminals on different Coms..
Last edited by Pito on Sat Jul 22, 2017 2:36 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by Pito » Sat Jul 22, 2017 12:48 pm

This doc
http://vt100.net/docs/vt3xx-gp/chapter13.html#S13.14
shows following table - how the Tek coordinates are sent, and how the "short version" of sending the coordinates works.

The key message here is, the last byte (Low X) is the byte which triggers the actual beam on, and does the draw..
The Tek includes a 5 bytes large "video buffer" where the internal logic detects the upper 2 bits (the "Tag bits") of incoming ASCII chars (actually bit 6 and 5 of a byte), and based on the sequence and the value decides what to do next.

When somebody needs the 12bits 4k x 4k mode, an additional "Extra" byte with top bits of each four coordinates must be sent as the second Y coordinate. The terminal shall detect that automatically and enhance the size.
Note: we do not send the Extra byte yet.
Tek Encoding the coordinates.JPG
Tek Encoding the coordinates.JPG (72.9 KiB) Viewed 170 times
The short addressing may speed up the drawing of the horizontal/vertical lines and boxes by 100%..
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by Pito » Sat Jul 22, 2017 4:05 pm

While deleting lines by overwriting them with the background ink works perfectly, overwriting the chars is leaving a weak artifacts like here
Font Artifacts.JPG
Font Artifacts.JPG (15.58 KiB) Viewed 147 times
Interesting. Maybe ClearType related?
Otherwise it works. No Tekcls() and static objects redraw is needed anymore :)..

Update: no artifacts with ie. Fixedsys font
Fixedsys.JPG
Fixedsys.JPG (12.37 KiB) Viewed 146 times
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by RogerClark » Sat Jul 22, 2017 9:42 pm

Excellent work..

ChrisMicro
Posts: 276
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by ChrisMicro » Sun Jul 23, 2017 5:44 am

Did I miss the source code?

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by RogerClark » Sun Jul 23, 2017 7:06 am

First post contained most of the code

viewtopic.php?f=18&t=2336#p31430

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: TEK 4010/4014 Vector Graphics terminal DEMO

Post by RogerClark » Sun Jul 23, 2017 7:25 am

I made it into a library

Not perfect...

#defines should be properties

Please feel free to fix this and generally improve it
Attachments
TEK_lib.zip
(3.25 KiB) Downloaded 10 times

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests