Author Topic: sending escape codes to Serial VFD with terminal program?  (Read 2022 times)

0 Members and 1 Guest are viewing this topic.

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
sending escape codes to Serial VFD with terminal program?
« on: October 23, 2017, 10:38:29 pm »
Most of the time, salvaged VFDs aren't terribly useful because you need to figure out the right voltages then some way to drive it but I just salvaged a nice Samsung 20m101da1 VFD that's simple, only needs 5V DC and accepts serial or parallel data.
I powered it from a 5V adapter and sent text to it at 19200 baud from TeraTerm using a little USB to Serial TTL adapter and it worked.

At first the text would start at the right side of the display and scroll to the left but after messing with it for a while the text comes in from the left of the display the wraps around back to the start when it hits the right edge of the 20 characters. This is what the datasheet calls Normal Mode.
"5.2.7 DC1 (11 Hex) : Normal Display Mode
After writing a character, the write-in position is shifted to the right one digit automatically.
When the write-in position is on the least significant digit, the cursor moves to the most
significant digit."

I'd like to make it go back to how it was the first time but I need to send it the right ESC codes.

QUESTION:
What would be the simplest way to send ESC (1B Hex) + DC3 (13 Hex) to switch to Horizontal Scroll Mode using something like TeraTerm?
I suppose I could connect the TX of an Arduino to it and send data to it that way but I'd like to see if it's possible with just the USB to Serial TTL adapter.

I can easily set this back to defaults by doing ESC (1B Hex) + "I" (49 Hex) because 0x49 is part of the standard ASCII characters but the setting I want to change requires me to send Hex values BELOW 0x20 which means that I can't just type it on a keyboard.

https://www.maltepoeggel.de/data/vfd/20m101da1.pdf
« Last Edit: October 23, 2017, 11:24:53 pm by dentaku »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: sending escape codes to Serial VFD with terminal program?
« Reply #1 on: October 24, 2017, 01:39:37 am »
Try Esc Ctrl-S.   Ctrl-A to Ctrl-Z send the ASCII codes 0x01 to 0x1A in *most* PC terminal programs, provided the terminal isn't reserving keys for Windows or its own use.

Alternatively use a terminal package like RealTerm that supports entering characters to be sent as HEX.
« Last Edit: October 24, 2017, 01:41:29 am by Ian.M »
 
The following users thanked this post: dentaku

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: sending escape codes to Serial VFD with terminal program?
« Reply #2 on: October 26, 2017, 02:55:18 pm »
Aha! That's another thing out of many things I didn't know about old terminal software.

Doing Esc Ctrl-S actually DOES work (most of the time) and sets it to Horizontal scroll mode. :-+

ALSO... This morning I found that there are Noritake Itron VFDs that work in exactly the same way. Reading the code on this page http://tronixstuff.com/2013/08/23/using-older-noritake-itron-vfd-modules/ I also see what I was doing wrong when trying to control it with an Arduino.

I was assuming ALL the codes needed an ESC before them but now I see that it's only the ones that include ASCII characters that are typable on a keyboard.
Something like 0x13 doesn't need the ESC before it.

For the last few days I was doing stuff like...
Serial.write(0x1B); //ESC
Serial.write(0x49); //I
and it worked fine and reset the display

BUT I was then doing    
Serial.write(0x1B); //ESC
Serial.write(0x13); //Horizontal Scroll Mode
when I didn't need to be doing the ESC at all

This seems to work as I expected.
While programming the Arduino lots of random junk gets written to the VDF so I do a Clear display first then set Horizontal scroll mode.
Code: [Select]
void setup()
{
Serial.begin(19200, SERIAL_8E1); // initialize serial
Serial.write(0x0E); //Clear display
Serial.write(0x13); //Horizontal Scroll Mode
}

void loop()
{
if (Serial.available())
{
char serialInput = Serial.read();
Serial.write(serialInput);
}
}

« Last Edit: October 26, 2017, 03:19:01 pm by dentaku »
 

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: sending escape codes to Serial VFD with terminal program?
« Reply #3 on: October 28, 2017, 01:02:14 am »
This doesn't use Horizontal Scroll mode but I thought I'd post a link to a video of this VFD displaying the output of my modified Chinese calipers.
I like that all it needs is +5V, GND and data from the TX pin of a Leonardo which is reading the data and clock pins of the calipers.
https://1drv.ms/v/s!ArYn6kcDECISkgoV-y_5XRAzU0Ec
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf