Page 1 of 1
CU20045SCPB-T23A custom driver custom character problem
Posted: February 24th, 2008, 8:10 pm
by knyghtryda
I have written a simple custom driver for the CU20045SCPB-T23A 4x20 VFD. So far, I have almost everything working (including brightness control) except for custom characters. Right now, I can't seem to figure out where the characters are being written. I have defined the character index as index + 0xC0. If I trying writing to to [chr + 0xC0] I'm finding that I'm still reading the character that originally existed there when custom characters are needed (smartie thinks the block character is written at 0xC2). However, if I write directly to 0xC2 then the software picks up the correct character (the block). Shouldn't the index of CustomCharIndex and the chr of CustomChar match? Thanks for any help.
Posted: February 24th, 2008, 8:47 pm
by grantb3
Posted: February 25th, 2008, 1:23 pm
by mattcro
You probably need to write your custom characters to addresses 0x00 - 0x07 (or maybe 0x08-0x0F), not 0xC0 (which I guess is what you're trying to do?) Can you actually replace ANY character with your own custom pattern on those VFDs?
The DISPLAYDLL_CustomCharIndex() function in your driver determines the mapping between Smartie's custom char index (1-8) and your display's internal custom char addressing (usually 0-7). For your display, you can probably just use (C++ code):
Code: Select all
DLL_EXPORT(LCDS_BYTE) DISPLAYDLL_CustomCharIndex(LCDS_BYTE index)
{
return index - 1;
}
If you put
$Chr(176) in your Smartie screen config, Smartie will tell the display driver to display custom character
1, which would get translated to character
0x00 in the example above. You must use the $Chr() commands in the table grantb linked to in order to display custom characters.
Posted: February 25th, 2008, 4:27 pm
by knyghtryda
actually, I can overwrite any character with a custom. I was able to overwrite 0xC2 with a block and smartie was able to successfully read it back out and display it. In order to do this though I had to hardcode that address into the custom character function. If I tried using the str variable, nothing works. This was also the case when I just used index - 1 as the addresses.