Page 1 of 1
Custom Bargraphs & Medium Numbers
Posted: Mon May 15, 2006 10:24 pm
by rrlal
Hi,
I've just purchased a PK162-12 (rev 3) module and I'm trying to use the custom characters for a horizontal bargraph. I use the create custom character command to send a custom character to the display, then I save it into Bank 1. I then load the custom char using the appropriate command and then call the place horizontal bar command. This draws the bargraph but using the default character set.
The 2nd problem that I'm having is medium numbers. I use the init medium numbers command and then call the place medium number command, but the display remains blank.
Can you please help me with these.
regards
Red
Posted: Tue May 16, 2006 10:37 am
by Raquel
Hi Red,
Thank you for posting on the forum.
When the units leave the factory, they are preloaded with the values for the following:
bank 0 - contains the startup characters for MO logo
bank 1 - contains that hoizontal bars
bank 2 - contains the vertical bars
bank 3 - contains the medium number chars
bank 4 - contains the large number chars
If you wish to use the default hoizontal bars, the commands you need to send are:
254 / 104 - to load the horizontal bars
254 / 124 / <column> / <row> / <dir> / <length>
eg. to draw a length of 10 from left to right starting at col 1, row 2
254 / 124 / 1 / 2 / 0 / 10
note on cmd 254 / 104 -- this command needs to be resent if the custom chars are initliazed to something else than horizonatal bars. But if you did not reinitialize the custom chars, you can continue sending horizontal commands and there is no need to send 254 / 104 every time.
In the case that you want to make your own horizontal bars, you will need to define your custom chars and send them all 8 bytes of a character in one command using 254 / 193. Eg:
254 / 193 / 1 / <character number> / <8 bytes that define the custom char>
-- 1 stands for bank 1 (horizontal bars)
-- <character number> is 0 - 7
-- <8 bytes> the definition of the character bytes.
According to the previous command then, if in case bank 1 is not pre-loaded with the horizontal bars, this is how you load it:
254 / 193 / 1 / 0 / 16 / 16 / 16 / 16 / 16 / 16 / 16 / 16 /
254 / 193 / 1 / 1 / 24 / 24 / 24 / 24 / 24 / 24 / 24 / 24 /
254 / 193 / 1 / 2 / 28 / 28 / 28 / 28 / 28 / 28 / 28 / 28 /
254 / 193 / 1 / 3 / 30 / 30 / 30 / 30 / 30 / 30 / 30 / 30 /
254 / 193 / 1 / 4 / 1 / 1 / 1 / 1 / 1 / 1 / 1 / 1 /
254 / 193 / 1 / 5 / 3 / 3 / 3 / 3 / 3 / 3 / 3 / 3 /
254 / 193 / 1 / 6 / 7 / 7 / 7 / 7 / 7 / 7 / 7 / 7 /
254 / 193 / 1 / 7 / 15 / 15 / 15 / 15 / 15 / 15 / 15 / 15 /
254 / 192 / 1 / -- this commands is equivalent to 254 / 104 which loads bank 1 for use
With the medium numbers, you should have been successful with the following commands (provided that the banks still contain the definition of medium nubers):
254 / 109 - initializes medium numbers
254 / 111 / 1 / 1 / 0 / - this places amedium digit '0' in row 1 column 1
I hope this helps.
Posted: Tue May 16, 2006 11:22 pm
by rrlal
Hi Raquel,
That was helpful. The datasheet for the rev 3 module is incorrect. It states the wrong command word and is missing the bank byte. This is why I was not able to get the display to behave.
Thanks for you help.
Red
Posted: Wed May 17, 2006 9:20 am
by Raquel
Hi Red,
I am glad that I helped you out. I will look into the incorrect info in the manual and make sure it is rectified, thank you for pointing it out.
Best Regards
Posted: Wed May 17, 2006 3:52 pm
by Henry
Hi Red,
Our entire product line got a full facelift and a full redesign over the last couple of months, so please excuse the mistake in the manual, we'll have it fixed up ASAP. Since we did the redesign, we totaly rewrote all the firmware and added tons of new features, like user defined bar graphs and digits... glad Raquel was able to help you out.
Posted: Wed May 17, 2006 7:11 pm
by rrlal
Hi,
Its good to know that your after sales service is good - I'm pleased with that.
I can go on to develop the application. If I have any questions, then I know where to come!
Regards
Red.