8 character display

16 Jan 2010 . Edited: 16 Jan 2010

Hey Guys,

Im trying to figure out how this VDO display system works. Basically I 6 bytes to it, via CAN. Which is all working great :). But I cannot figure out how they are doing the text encoding. Maybe one of the LCD guys might of seen something kinda like it.

Heres my output

Basically the first 4 characters are set by the first 3 bytes, and the last 4 four are set by bytes 4,5 & 6

i.e

FF FF FF => Character1, Character2, Character3, Character4

 

30 bF 00 => Display output (A.  )

30 c0 00 => Display output AA2

30 c2 00 => Display output (AA.)

30 c2 cc => Display output (AA.A)

30 c1 cc => Display output (AA6A)

30 f3 cc => Display output (ADDA)

30 c2 00 => Display output (AA7A)

 

Some other test output

 

11 00 00 => 3T

0b 00 00 => 1

10 00 00 => 3D

09 00 00 => 1T

08 00 00 => 1D

07 00 00 => 0

05 00 00 => 0T

04 00 00 => OD

 

85 46 D0 38 b2 => Display output (VIPEC..)

 

If anyone can shed some light on how this is being encoded would be most helpful.

Cheers Jason

 

16 Jan 2010

Since 3 bytes is 4 characters, you get 3*8/4 = 6 bits per character. Let's see how it works out for your samples.

ADDA: 30 f3 cc -> 001100 001111 001111 001100 
AA6A: 30 c1 cc -> 001100 001100 000111 001100
VIPEC: 85 46 D0 38 b2 -> 100001 010100 011011 010000 001110 001011 0010xx

Let's write out some values:

A 001100 12
D 001111 15
6 000111 7
V 100001 33
I 010100 20

So it seems something like the following:

If x is a digit then code = (x-'0')+1
If x is an uppercase letter, then code = (x-'A')+12

To figure out the missing ranges, you'll need to try other codes. The following code should help you:

// pack four 6-bit values into 3 bytes
void Four2Three(unsigned char *in, unsigned char *out)
{
  // aaaaaa bb | bbbb cccc | cc dddddd 
  out[0]=((in[0]<<2)&0x3F) | ((in[1]>>4)&3);
  out[1]=((in[1]&0xF)<<4)  | ((in[2]>>2)&0xF);
  out[2]=((in[2]&0x3)<<6)  | (in[3]&0x3F);
}

....
int main()
{
    // try all 64 codes
    for ( int i=0; i<64; i++ )
    {
      printf("Trying character code %d (0x%X)\n", i, i);
      unsigned char in[8], out[6];
      // set all characters to the same value
      for ( int j=0; j<8; j++)
        in[j] = i;
      
      // pack into bytes  
      Four2Three(in, out);
      Four2Three(&in[4], &out[3]);
      // send the message
      CANMessage msg(id, (char*)out, 6);
      can1.write(msg);
      // wait two seconds
      wait(2);
    }
}
17 Jan 2010 . Edited: 17 Jan 2010

Thanks Igor for the help with this. This seems to be 99% right.

0 = No display

1 - 15 is correct (through from 0000 0000 -> EEEE EEEE)

When it hits an E(16) in the first column this is where things get a little weird.

it doesnt seem to like a number less than 0x05 in the first byte(which happens on E/16) And from then onwards say the first column is 0x11 it is out by 0x40 . So to fix it, im sure this is not the correct answer but it works,

// pack into bytes

Four2Three(in, out);

Four2Three(&in[4], &out[3]);

if(i>15) {

out[0]= out[0]+0x40;

out[3]= out[3]+0x40;

}

if(i>31) {

out[0]= out[0]+0x40;

out[3]= out[3]+0x40;

}

 

// send the message

CANMessage msg(id, (char*)out, 6);