• PicŪ Basic


  • How To... PPRINT tips and tricks 1

    by Tim Box

    Explanation

    Pprint offer great flexibility, and improves the appearance of a GLCD no end. The fonts though can take a lot of code space, which might be very wasteful when you really only want to display large numbers.

    The trick is to reduce the font to hold just the characters you require.

    This is how to store only the numbers from a font, Chrs48 to Chrs57 / 0 to 9

    Open the font file and remove all CDATA from character " " to "/", but leaving the labels in place. Next remove all the labels and data from ":" onwards. Lastly remove all the labels from the look up table, label 57 onwards.

    Note. you have to leave the labels before "0" to enable the correct character data to be addressed.

    The same technique can be used to store only the characters you use no matter what they are or in what sequence. But remember to save the label names unless they are after the last character you want to use.

    Code:
    '
    ' FONT information for  Arial  - Font Size 16 (Point Size 12) Bold 
    '---------------------------------------------------------------------------------------------------'
    '
    '
    ' Pointers to the actual font table
    '
    Arial_B__12:-
    
    Cdata     word 16 ' Font is 16 High
    
    Cdata      Arial_B__12_0,Arial_B__12_1,Arial_B__12_2,Arial_B__12_3,Arial_B__12_4,Arial_B__12_5,_
               Arial_B__12_6,Arial_B__12_7,Arial_B__12_8,Arial_B__12_9,Arial_B__12_10,_
               Arial_B__12_11,Arial_B__12_12,Arial_B__12_13,Arial_B__12_14,Arial_B__12_15,_
               Arial_B__12_16,Arial_B__12_17,Arial_B__12_18,Arial_B__12_19,Arial_B__12_20,_
               Arial_B__12_21,Arial_B__12_22,Arial_B__12_23,Arial_B__12_24,Arial_B__12_25
              
    ' Font data
    
    Arial_B__12_0:-  
    Arial_B__12_1:-  
    Arial_B__12_2:-  
    Arial_B__12_3:-  
    Arial_B__12_4:-  
    Arial_B__12_5:- 
    Arial_B__12_6:-  
    Arial_B__12_7:-  
    Arial_B__12_8:-
    Arial_B__12_9:-  
    Arial_B__12_10:- 
    Arial_B__12_11:-
    Arial_B__12_12:- 
    Arial_B__12_13:-  
    Arial_B__12_14:- 
    Arial_B__12_15:-  
    Arial_B__12_16:-
    CDATA 9,240,3,252,15,14,28,6,24,6,24,14,28,252,15,240,3,0,0 ' Code for  char 0  
    Arial_B__12_17:-
    CDATA 6,48,0,24,0,12,0,254,31,254,31,0,0 ' Code for char 1  
    Arial_B__12_18:-
    CDATA 9,24,24,28,28,14,30,6,27,134,27,198,25,252,24,56,24,0,0 ' Code for  char 2  
    Arial_B__12_19:-
    CDATA 9,8,6,12,14,6,28,102,24,102,24,230,28,252,15,156,7,0,0 ' Code for  char 3  
    Arial_B__12_20:-
    CDATA 9,0,7,128,7,224,6,112,6,28,6,254,31,254,31,0,6,0,0 ' Code for char  4  
    Arial_B__12_21:-
    CDATA 9,224,6,254,14,110,28,102,24,102,24,230,28,198,15,128,7,0,0 ' Code  for char 5  
    Arial_B__12_22:-
    CDATA 9,240,3,252,15,204,28,102,24,102,24,230,28,206,15,140,7,0,0 ' Code  for char 6  
    Arial_B__12_23:-
    CDATA 9,6,0,6,0,6,30,198,31,246,1,62,0,14,0,6,0,0,0 ' Code for char 7  
    Arial_B__12_24:-
    CDATA 9,56,7,252,15,198,24,198,24,198,24,198,24,252,15,56,7,0,0 ' Code  for char 8  
    Arial_B__12_25:-
    CDATA 9,120,12,252,28,206,25,134,25,134,25,206,12,252,15,240,3,0,0 '  Code for char 9
  • Recent Activity

    towlerg-21522

    Mysterious PORTB problem

    Thread Starter: xldaedalus

    I'm using Proton+ to develop firmware for a product with switches. The MCU is an 18F26K22. Most of the switches reside on PORTB. I am NOT using a...

    towlerg Today, 15:19 Go to last post
    towlerg-21522

    PIC18F1330 PLL problem

    Thread Starter: rcurl

    I'm just starting out on a new project that uses a PIC18F1330. I haven't used this specific chip before, so I began by trying to blink an LED just...

    towlerg Today, 16:07 Go to last post
    towlerg-21522

    Lin bus and auto baud detection

    Thread Starter: Tim

    Lin bus looks to be a great system for an application i'm working on. One of the main things is the slave can be really simple without needing a...

    towlerg Today, 15:13 Go to last post