Data Sheet for iMon VFD

Linux support for Soundgraph iMON USB IR/VFD modules used in Ahanix, Silverstone, Uneed, Accent and other cases.

Moderator: Venky

Post Reply
heat_vision
Posts: 2
Joined: Sat Sep 23, 2006 11:16 pm

Data Sheet for iMon VFD

Post by heat_vision » Sun Sep 24, 2006 3:41 am

I want to add the ability to display graphical output on the iMon VFD. The windows API (SG_VFD.dll) provides a function called iMONVFD_SetEQ() to display a graphical equalizer so obviously the capability is there to some extent.

I have had a look at the data sheet for the 16T202DA1J and it appears that it is possible to draw an arbitrary 20x14 pixel image by displaying the 8 CG-RAM characters in a 4x2 layout. Each CG-RAM character can be set to an arbitrary 5x7 pattern giving the appearance of a 20x14 image. My VFD appears to differ from the data sheet in that it has an extra 8th line per character giving instead 5x8 -> 20x16.

By default, the iMon sets the CG-RAM characters to be consecutively taller rectangles (i.e. what you would expect would be necessary to make a graphic equalizer). I would like to know if there is a way for the user to change them. My gut feeling was that the 6th packet that needs to be sent to iMon devices with vendor ID 0x15c2 was added to provide this type of extended functionality. However, changing the data transmitted in the 6th packet does not appear to have any effect on the characters displayed on the VFD.

Does anyone have a data sheet for the iMon VFD that describes the purpose of this 6th packet or perhaps a different method for changing the characters in CG-RAM?

heat_vision
Posts: 2
Joined: Sat Sep 23, 2006 11:16 pm

Post by heat_vision » Sun Sep 24, 2006 7:56 pm

After futher experimentation it appears that doing what I suggested above will not be as effective as I thought. The perl script below uses LCDproc to draw a random single channel graphic equalizer using both rows on the iMon display. I find that the blank gap between the rows is too distracting from the intended effect. This distraction would be many times worse if trying to display an image.

Code: Select all

#!/usr/bin/perl -w

use strict;
use IO::Socket;
use Time::HiRes qw(usleep);

# Host to connect to
my $HOST = "localhost";

# Port to connect to
my $PORT = "13666";

# Connect to the server...
my $remote = IO::Socket::INET->new(
			Proto     => "tcp",
			PeerAddr  => $HOST,
			PeerPort  => $PORT,
	)
	|| die "Cannot connect to LCDd\n";

# Make sure our messages get there right away
$remote->autoflush(1);

sleep 1;        # Give server plenty of time to notice us...

print $remote "hello\n";
# Note: it's good practice to listen for a response after a print to the
# server even if there isn't meant to be one. If you don't, you may find
# your program crashes after running for a while when the buffers fill up:
my $lcdresponse = <$remote>;
print $lcdresponse;

my @cmds = (
	'screen_add equalizer',
	'screen_set equalizer -priority foreground -heartbeat off',

	'widget_add equalizer line1 string',
	'widget_set equalizer line1 1 1 {Hello World}',

	'widget_add equalizer line2 string',
);

sub sendcmd {
	my $cmd = shift || die;
	print $remote "$cmd\n";
	my $lcdresponse = <$remote>;
	print "Sent $cmd received $lcdresponse\n";
}

foreach(@cmds) {
	sendcmd($_);
}

my @eq_values = (
	[ 32, 32 ], # Value of 0 is space,space
	[ 32, 8 ], # Value of 1 is space, 1 bar
	[ 32, 1 ], # Value of 2 is space, 2 bars
	[ 32, 2 ], # Value of 3 is space, 3 bars
	[ 32, 3 ], # Value of 4 is space, 4 bars
	[ 32, 4 ], # Value of 5 is space, 5 bars
	[ 32, 5 ], # Value of 6 is space, 6 bars
	[ 32, 6 ], # Value of 7 is space, 7 bars
	[ 32, 7 ], # Value of 8 is space, 8 bars
	[ 8, 7 ], # Value of 9 is 1 bar, 8 bars
	[ 1, 7 ], # Value of 10 is 2 bars, 8 bars
	[ 2, 7 ], # Value of 11 is 3 bars, 8 bars
	[ 3, 7 ], # Value of 12 is 4 bars, 8 bars
	[ 4, 7 ], # Value of 13 is 5 bars, 8 bars
	[ 5, 7 ], # Value of 14 is 6 bars, 8 bars
	[ 6, 7 ], # Value of 15 is 7 bars, 8 bars
	[ 7, 7 ], # Value of 16 is 8 bars, 8 bars
);

sub SetEQ {
	my $array_ref = shift || die;

	my $line1 = "";
	my $line2 = "";

	for(my $i = 0; $i < 16; $i++) {
		$line1 .= chr($eq_values[$$array_ref[$i]][0]);
		$line2 .= chr($eq_values[$$array_ref[$i]][1]);
	}
	sendcmd("widget_set equalizer line1 1 1 {$line1}");
	sendcmd("widget_set equalizer line2 1 2 {$line2}");
}

my @eqvals;

# Initialise with a random number between (0,16)
foreach(0..15) {
	$eqvals[$_] = int(rand(17));
}

for(;;) {
	for(my $i = 0; $i < 16; $i++) {
		$eqvals[$i] += int(rand(5)) - 2;
		$eqvals[$i] = 0 if($eqvals[$i] < 0);
		$eqvals[$i] = 16 if($eqvals[$i] > 16);
		usleep 10000;
	}
	SetEQ(\@eqvals);
}

Post Reply