VK202-25 Custom Character Throbber

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
Rich G.
LCD?
Posts: 2
Joined: Mon Mar 25, 2013 12:46 pm

VK202-25 Custom Character Throbber

Post by Rich G. »

I'm brand new to programming the VK202-25 display so bear with me... Don't be afraid to point me to FAQ's or other places of interest. I'm just not sure where these are yet...

I'm in the process of displaying characters on the display ( using write() commands in a c program on Linux )

I tried writing a very simple program to display the old '|', '/', '-', '\' text throbber. Come to find out my display shows that 'Y' with some lines through the lower stem instead of '\' which means my display is using the Japanese Character Set instead of the European set.

Is there a way to telly my display to use the European character set instead of the Japanese character set? Can I load complete custom character sets?

Assuming there isn't a way ... I see there are ways to create up to 8 custom characters via:

0xfe 0x4e n b[0-7]
n = Character ID
b[0-7] = bit pattern of the 8 custom character.

Once the custom character is loaded, how do I display it? do I just send 0x00 thru 0x07 like this:

Code: Select all

const unsigned char custom[] = {0xfe, 0x43, 0x00, 8, 20, 8, 3, 4, 4, 3};

write(fd, custom, 10);

c = 0x00;
write(fd, &c, 1);

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: VK202-25 Custom Character Throbber

Post by Clark »

No worries Rich, looks like you already have a good understanding of the VK202-25.

You are correct: our VFD units will have a Japanese font, and unfortunately it cannot be changed. You have already found the solution to this problem, which will be custom characters, and from what I see your code looks good (custom characters are indeed displayed by sending their ID).

If you're looking for info/ideas for your display, please don't hesitate to check out http://www.matrixorbital.ca, specifically the AppNote section.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

Rich G.
LCD?
Posts: 2
Joined: Mon Mar 25, 2013 12:46 pm

Re: VK202-25 Custom Character Throbber

Post by Rich G. »

Thanks for pointing me in the right direction. Here's some psuedo-code for what I ended up doing which is working fine. I left out all the serial port set up stuff assuming people can acquire fd as they see fit:

Code: Select all

const unsigned char VK202_CMD_SPINPOSIT[] = {0xfe, 0x47, 20, 1};

const unsigned char VK202_CUSTOMCHAR0[] = {0xfe, 0x4e, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR1[] = {0xfe, 0x4e, 0x01, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR2[] = {0xfe, 0x4e, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR3[] = {0xfe, 0x4e, 0x03, 0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR4[] = {0xfe, 0x4e, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR5[] = {0xfe, 0x4e, 0x05, 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR6[] = {0xfe, 0x4e, 0x06, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00};
const unsigned char VK202_CUSTOMCHAR7[] = {0xfe, 0x4e, 0x07, 0x00, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00};

void f_VK202_LoadCustomChars(int fd)
{
  write(fd, VK202_CUSTOMCHAR0, sizeof(VK202_CUSTOMCHAR0));
  write(fd, VK202_CUSTOMCHAR1, sizeof(VK202_CUSTOMCHAR1));
  write(fd, VK202_CUSTOMCHAR2, sizeof(VK202_CUSTOMCHAR2));
  write(fd, VK202_CUSTOMCHAR3, sizeof(VK202_CUSTOMCHAR3));
  write(fd, VK202_CUSTOMCHAR4, sizeof(VK202_CUSTOMCHAR4));
  write(fd, VK202_CUSTOMCHAR5, sizeof(VK202_CUSTOMCHAR5));
  write(fd, VK202_CUSTOMCHAR6, sizeof(VK202_CUSTOMCHAR6));
  write(fd, VK202_CUSTOMCHAR7, sizeof(VK202_CUSTOMCHAR7));
}

void f_VK202_Throbber(int fd)
{
  static char c;

  write(fd, VK202_CMD_SPINPOSIT, sizeof(VK202_CMD_SPINPOSIT));
  write(fd, &c, 1);
  c++;
  if( c == 8 ) c = 0;
}

int main(void)
{
  //-- Init serial port stuff here

  f_VK202_LoadCustomChars(fd);
  while(1)
  {
    //-- Do stuff here
    f_VK202_Throbber(fd);
    sleep(1);
  }
  return(1);
}

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: VK202-25 Custom Character Throbber

Post by Clark »

Not a problem Rich, your code looks great. Thanks for sharing this useful little feature with the community.
Troy
Troy Clark
Design & Development
Matrix Orbital

Post Reply