1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

How to use Interrupt in PIC16F877A in C..??

Discussion in 'Microcontrollers' started by koolguy, Jan 14, 2013.

  1. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    If i will do that then it must be saved in PIC memory also??

    In this code the font is saved in E2PROM it work well but the speed was getting slow and LED was Blinking..so, i am deciding to use Program memory i.e. Flash memory..
    but the syntax is showing error..??
    Code (text):
    FLASH_WRITE(address,value);
     

    Attached Files:

  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    NNNOOOOO You can use the external file and just link it in.... If you include the font1.c in the build you just need the external reference that I gave you.. Exactly the same as tutorial 13...
     
  3. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    OK, i will try first pls help me with flash memory issue how to use when i wrote any function name suffix with @addr it work..
    but how to save data in it??
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK

    You don't have to.......when you have your project open in MPLAB... where the source file are shown on the left... just include the "font1.c"... If the font is declared as "const unsigned char" then it will be place in program memory... You then place the external declaration that I gave you in the main c file....
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    Try to view this.... Its the whole of tutorial 13 using MPLAB and ISIS..

    You should see what I have done to place the code in code space..
     

    Attached Files:

  7. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    OK, first i have to save font file file in MP LAB folder with .C and "const unsigned char"....then what to do?
    if my code are written in other file like MATRIX.C then how to include it...and you are telling to store as .C but header file are in .H, pls explain this...
     
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    I wish I could get time to do a video... You don't need a header.

    If you have a file in your build with only one item... ie.. the 2d array..

    Code (text):

    const unsigned char Font1[] = {
       1,2,3,4,5,6,7,8,
       1,2,3,4,5,6,7,8,
       1,2,3,4,5,6,7,8,
       1,2,3,4,5,6,7,8,
       1,2,3,4,5,6,7,8,
       1,2,3,4,5,6,7,8};
     
    saved as "matrix.c"..... when you write your main code, you just reference it.

    Code (text):

    #include <headers.h>
    #define stuff // config, xtal etc...

    external const unsigned char Font1[];  //<<-- declare as external here....

    void main()
    {
        unsigned char x;
        x = Font1[3];   // <<<--- this will access the array in matrix.c.

    }

     
    That's pretty much all you need to do..
     
    • Like Like x 1
  9. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Can you explain more on this the space used is not clear to me as there is only 8bit on memory per addr.. so, how will the memory wasted??
     
  10. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    An int is defined in C as a word.... Two Bytes!! An unsigned char is One Byte... You are using a byte array not an int array... If it where declared as an int array it would be twice as big as it needs to be... If you are using the free version of Hitech...( I assume you are ) Hitech already double your ram usage anyway....
     
  11. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    why???, it will be stored in flash??
     
  12. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    Flash IS program memory... Same stuff... The Pic has 8 k of FLASH code space 368 bytes of RAM space and 255 bytes of EEprom space.

    const char = code (flash)... char = ram... eeprom is char as well but YOU need to retrieve it.
     
  13. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Why...???
     
  14. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    Why what!!! Because it is.... In C constants are placed in flash (code space) and variables are placed in ram... Or you can put them in the small eeprom space
     
  15. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    OK, As i was talking about matrix display i want your suggestion which method should i use for scanning rows i have got 270 LED 3mm RED colours...??
    1. 3 to 8 decoder
    2. 4017
    3. Or direct to PORTB,???
     
  16. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    An 8x8 matrix has 64 led's... I take it you want more 8 x 8 ( 270 red led's) The best way is to use column diving..the same way they do it in the ks0107 chip.

    If you try to run two matrices you will need 16 column drivers (easily done by the pic16f877a ) If you implement some sort of shift register you can drive more columns BUT the difficulty come when the LED aren't lit for long enough for you to see...

    EG.. Driving 2 seven segment units is simple enough.. When driving 4 it becomes apparent that the on off time is depreciating.... Driving 8... then you really need to up the led brightness so the visibility would be better... not only do people use shift registers... They use line drivers as well. You can use super bight LED's then.


    One full line lit directly from a pic.... 100mA per port... 8 bits = 12.5mA per LED... You can argue that you are sourcing from one port and sinking on another. But mA's are mA's.

    In reality you should have row drivers AND column drivers so the pic won't suffer..

    See here.. Someone using a shift register ( with the code )... http://www.pic-tronics.com/Dot-Matrix-Driving.php
     
  17. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    here is my PCB layout any suggestion will be appreciated...

    The link you have provided is using single shift register....i was thinking to use 4to16 decoder with bc547 BJT...will it work...??
     

    Attached Files:

  18. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Hi, as per you suggestion i have used this

    Code (text):
    // Declare and Init the font array data
    const unsigned char Font1[32][7] = {
       {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}   // 0x20, Space
       {0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04,}   // 0x21, !
       {0x09, 0x09, 0x12, 0x00, 0x00, 0x00, 0x00,}   // 0x22, "
       {0x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a,}   // 0x23, #
       {0x04, 0x0f, 0x14, 0x0e, 0x05, 0x1e, 0x04,}   // 0x24, $
       {0x19, 0x19, 0x02, 0x04, 0x08, 0x13, 0x13,}   // 0x25, %
       {0x04, 0x0a, 0x0a, 0x0a, 0x15, 0x12, 0x0d,}   // 0x26, &
       {0x04, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,}   // 0x27, '
       {0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02,}   // 0x28, (
       {0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08,}   // 0x29, )
       {0x04, 0x15, 0x0e, 0x1f, 0x0e, 0x15, 0x04,}   // 0x2a, *
       {0x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00,}   // 0x2b, +
       {0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x08,}   // 0x2c, ,
       {0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,}   // 0x2d, -
       {0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c,}   // 0x2e, .
       {0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10,}   // 0x2f, /
       {0x0e, 0x11, 0x13, 0x15, 0x19, 0x11, 0x0e,}   // 0x30, 0
       {0x04, 0x0c, 0x04, 0x04, 0x04, 0x04, 0x0e,}   // 0x31, 1
       {0x0e, 0x11, 0x01, 0x02, 0x04, 0x08, 0x1f,}   // 0x32, 2
       {0x0e, 0x11, 0x01, 0x06, 0x01, 0x11, 0x0e,}   // 0x33, 3
       {0x02, 0x06, 0x0a, 0x12, 0x1f, 0x02, 0x02,}   // 0x34, 4
       {0x1f, 0x10, 0x1e, 0x01, 0x01, 0x11, 0x0e,}   // 0x35, 5
       {0x06, 0x08, 0x10, 0x1e, 0x11, 0x11, 0x0e,}   // 0x36, 6
       {0x1f, 0x01, 0x02, 0x04, 0x08, 0x08, 0x08,}   // 0x37, 7
       {0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e,}   // 0x38, 8
       {0x0e, 0x11, 0x11, 0x0f, 0x01, 0x02, 0x0c,}   // 0x39, 9
       {0x00, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x00,}   // 0x3a, :
       {0x00, 0x0c, 0x0c, 0x00, 0x0c, 0x04, 0x08,}   // 0x3b, ;
       {0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02,}   // 0x3c, <
       {0x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00,}   // 0x3d, =
       {0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08,}   // 0x3e, >
       {0x0e, 0x11, 0x01, 0x02, 0x04, 0x00, 0x04,}   // 0x3f, ?
       };

    const unsigned char Font2[32][7] = {
       {0x0e, 0x11, 0x17, 0x15, 0x17, 0x10, 0x0f,}   // 0x40, @
       {0x04, 0x0a, 0x11, 0x11, 0x1f, 0x11, 0x11,}   // 0x41, A
       {0x1e, 0x11, 0x11, 0x1e, 0x11, 0x11, 0x1e,}   // 0x42, B
       {0x0e, 0x11, 0x10, 0x10, 0x10, 0x11, 0x0e,}   // 0x43, C
       {0x1e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x1e,}   // 0x44, D
       {0x1f, 0x10, 0x10, 0x1c, 0x10, 0x10, 0x1f,}   // 0x45, E
       {0x1f, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10,}   // 0x46, F
       {0x0e, 0x11, 0x10, 0x10, 0x13, 0x11, 0x0f,}   // 0x37, G
       {0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11,}   // 0x48, H
       {0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e,}   // 0x49, I
       {0x1f, 0x02, 0x02, 0x02, 0x02, 0x12, 0x0c,}   // 0x4a, J
       {0x11, 0x12, 0x14, 0x18, 0x14, 0x12, 0x11,}   // 0x4b, K
       {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f,}   // 0x4c, L
       {0x11, 0x1b, 0x15, 0x11, 0x11, 0x11, 0x11,}   // 0x4d, M
       {0x11, 0x11, 0x19, 0x15, 0x13, 0x11, 0x11,}   // 0x4e, N
       {0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,}   // 0x4f, O
       {0x1e, 0x11, 0x11, 0x1e, 0x10, 0x10, 0x10,}   // 0x50, P
       {0x0e, 0x11, 0x11, 0x11, 0x15, 0x12, 0x0d,}   // 0x51, Q
       {0x1e, 0x11, 0x11, 0x1e, 0x14, 0x12, 0x11,}   // 0x52, R
       {0x0e, 0x11, 0x10, 0x0e, 0x01, 0x11, 0x0e,}   // 0x53, S
       {0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,}   // 0x54, T
       {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,}   // 0x55, U
       {0x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04,}   // 0x56, V
       {0x11, 0x11, 0x11, 0x15, 0x15, 0x1b, 0x11,}   // 0x57, W
       {0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11,}   // 0x58, X
       {0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, 0x04,}   // 0x59, Y
       {0x1f, 0x01, 0x02, 0x04, 0x08, 0x10, 0x1f,}   // 0x5a, Z
       {0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e,}   // 0x5b, [
       {0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01,}   // 0x5c, \
       {0x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e,}   // 0x5d, ]
       {0x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00,}   // 0x5e, ^
       {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,}   // 0x5f, _
       };

    const unsigned char Font3[32][7] = {
       {0x04, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00,}   // 0x60, `
       {0x00, 0x0e, 0x01, 0x0d, 0x13, 0x13, 0x0d,}   // 0x61, a
       {0x10, 0x10, 0x10, 0x1c, 0x12, 0x12, 0x1c,}   // 0x62, b
       {0x00, 0x00, 0x00, 0x0e, 0x10, 0x10, 0x0e,}   // 0x63, c
       {0x01, 0x01, 0x01, 0x07, 0x09, 0x09, 0x07,}   // 0x64, d
       {0x00, 0x00, 0x0e, 0x11, 0x1f, 0x10, 0x0f,}   // 0x65, e
       {0x06, 0x09, 0x08, 0x1c, 0x08, 0x08, 0x08,}   // 0x66, f
       {0x0e, 0x11, 0x13, 0x0d, 0x01, 0x01, 0x0e,}   // 0x67, g
       {0x10, 0x10, 0x10, 0x16, 0x19, 0x11, 0x11,}   // 0x68, h
       {0x00, 0x04, 0x00, 0x0c, 0x04, 0x04, 0x0e,}   // 0x69, i
       {0x02, 0x00, 0x06, 0x02, 0x02, 0x12, 0x0c,}   // 0x6a, j
       {0x10, 0x10, 0x12, 0x14, 0x18, 0x14, 0x12,}   // 0x6b, k
       {0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,}   // 0x6c, l
       {0x00, 0x00, 0x0a, 0x15, 0x15, 0x11, 0x11,}   // 0x6d, m
       {0x00, 0x00, 0x16, 0x19, 0x11, 0x11, 0x11,}   // 0x6e, n
       {0x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e,}   // 0x6f, o
       {0x00, 0x1c, 0x12, 0x12, 0x1c, 0x10, 0x10,}   // 0x70, p
       {0x00, 0x07, 0x09, 0x09, 0x07, 0x01, 0x01,}   // 0x71, q
       {0x00, 0x00, 0x16, 0x19, 0x10, 0x10, 0x10,}   // 0x72, r
       {0x00, 0x00, 0x0f, 0x10, 0x0e, 0x01, 0x1e,}   // 0x73, s
       {0x08, 0x08, 0x1c, 0x08, 0x08, 0x09, 0x06,}   // 0x74, t
       {0x00, 0x00, 0x11, 0x11, 0x11, 0x13, 0x0d,}   // 0x75, u
       {0x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04,}   // 0x76, v
       {0x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a,}   // 0x77, w
       {0x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11,}   // 0x78, x
       {0x00, 0x11, 0x11, 0x0f, 0x01, 0x11, 0x0e,}   // 0x79, y
       {0x00, 0x00, 0x1f, 0x02, 0x04, 0x08, 0x1f,}   // 0x7a, z
       {0x06, 0x08, 0x08, 0x10, 0x08, 0x08, 0x06,}   // 0x7b, {
       {0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x04,}   // 0x7c, |
       {0x0c, 0x02, 0x02, 0x01, 0x02, 0x02, 0x0c,}   // 0x7d, }
       {0x08, 0x15, 0x02, 0x00, 0x00, 0x00, 0x00,}   // 0x7e, ~
       {0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,}   // 0x7f, DEL
       };
    and saved as font.C..........

    then called it by...


    showing error...
    Make: The target "C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.p1" is out of date.
    Executing: "C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe" --pass1 "C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C" -q --chip=16F877A -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
    Warning [374] C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C; 10.10 missing basic type; int assumed
    Error [314] C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C; 10.10 ";" expected
    Error [192] C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C; 16.5 undefined identifier "Font1"
    Error [981] C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C; 16.13 pointer required
    Error [981] C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C; 16.13 pointer required
    Error [192] C:\Documents and Settings\WETA DIGITAL\My Documents\map\flash.C; 17.1 undefined identifier "DAD"

    ********** Build failed! **********


    HI again,

    Its working now, I notice that fboth file should be included to source file!!!
     
    Last edited: Jan 27, 2013
  19. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    The code is working fine.....
    but i have seen your tutorial 13, you were using string, please tell how to add string while selecting its array row column automatically..??

    Code (text):
    #include <htc.h>
    __CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_XT);
    #define _XTAL_FREQ 4000000
    #define DAD PORTB
    #define RST RD7
    #define CLK RD4
    #define DATA RD5
    #define D 1
    extern const unsigned char Font2[32][7];
    int data(int a);
    main (){
    TRISD=0B00000000;
    TRISB=0B00000000;
    while(1){
    DAD=0X00;
    int a;

    for(int i=1;i<32;i++){


    for (int k=0;k<100;k++){
    int o=0;
    a=Font2[i][o];
    data(a);
    DAD=0X80;
    __delay_ms(D);
    o++;

    a=Font2[i][o];
    data(a);
    DAD=0X40;
    __delay_ms(D);
    o++;
    a=Font2[i][o];
    data(a);
    DAD=0X20;
    __delay_ms(D);
    o++;
    a=Font2[i][o];
    data(a);
    DAD=0X10;
    __delay_ms(D);
    o++;
    a=Font2[i][o];
    data(a);
    DAD=0X08;
    __delay_ms(D);
    o++;
    a=Font2[i][o];
    data(a);
    DAD=0X04;
    __delay_ms(D);
    o++;
    a=Font2[i][o];
    data(a);
    DAD=0X02;
    __delay_ms(D);
    o++;






    }
    }
    }
    }


    int data(int a)
    {
    RST=0;
    RST=1;

    DAD=0X00;
    for (int k=0; k<8;k++) {  
    CLK = 0;  
        if ((a & 0x01)==1) DATA = 1;

        else DATA =0;

        CLK =1;

        a >>=1;
    } }
     
     
  20. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    Excellent.... One thing.. You have 3 arrays... So you have to put 3 declarations in the main C file

    external const unsigned char Font1[][];
    external const unsigned char Font2[][];
    external const unsigned char Font3[][];

    I would just do this..

    Code (text):

    // Declare and Init the font array data
    const unsigned char Font[] = {
       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 0x20, Space
       0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04,   // 0x21, !
       0x09, 0x09, 0x12, 0x00, 0x00, 0x00, 0x00,   // 0x22, "
       0x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a,   // 0x23, #
       0x04, 0x0f, 0x14, 0x0e, 0x05, 0x1e, 0x04,   // 0x24, $
       0x19, 0x19, 0x02, 0x04, 0x08, 0x13, 0x13,   // 0x25, %
       0x04, 0x0a, 0x0a, 0x0a, 0x15, 0x12, 0x0d,   // 0x26, &
       0x04, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,   // 0x27, '
       0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02,   // 0x28, (
       0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08,   // 0x29, )
       0x04, 0x15, 0x0e, 0x1f, 0x0e, 0x15, 0x04,   // 0x2a, *
       0x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00,   // 0x2b, +
       0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x08,   // 0x2c, ,
       0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,   // 0x2d, -
       0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c,   // 0x2e, .
       0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10,   // 0x2f, /
       0x0e, 0x11, 0x13, 0x15, 0x19, 0x11, 0x0e,   // 0x30, 0
       0x04, 0x0c, 0x04, 0x04, 0x04, 0x04, 0x0e,   // 0x31, 1
       0x0e, 0x11, 0x01, 0x02, 0x04, 0x08, 0x1f,   // 0x32, 2
       0x0e, 0x11, 0x01, 0x06, 0x01, 0x11, 0x0e,   // 0x33, 3
       0x02, 0x06, 0x0a, 0x12, 0x1f, 0x02, 0x02,   // 0x34, 4
       0x1f, 0x10, 0x1e, 0x01, 0x01, 0x11, 0x0e,   // 0x35, 5
       0x06, 0x08, 0x10, 0x1e, 0x11, 0x11, 0x0e,   // 0x36, 6
       0x1f, 0x01, 0x02, 0x04, 0x08, 0x08, 0x08,   // 0x37, 7
       0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e,   // 0x38, 8
       0x0e, 0x11, 0x11, 0x0f, 0x01, 0x02, 0x0c,  // 0x39, 9
       0x00, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x00,   // 0x3a, :
       0x00, 0x0c, 0x0c, 0x00, 0x0c, 0x04, 0x08,   // 0x3b, ;
       0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02,   // 0x3c, <
       0x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00,   // 0x3d, =
       0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08,   // 0x3e, >
       0x0e, 0x11, 0x01, 0x02, 0x04, 0x00, 0x04,   // 0x3f, ?
       0x0e, 0x11, 0x17, 0x15, 0x17, 0x10, 0x0f,   // 0x40, @
       0x04, 0x0a, 0x11, 0x11, 0x1f, 0x11, 0x11,   // 0x41, A
       0x1e, 0x11, 0x11, 0x1e, 0x11, 0x11, 0x1e,   // 0x42, B
       0x0e, 0x11, 0x10, 0x10, 0x10, 0x11, 0x0e,   // 0x43, C
       0x1e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x1e,   // 0x44, D
       0x1f, 0x10, 0x10, 0x1c, 0x10, 0x10, 0x1f,   // 0x45, E
       0x1f, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10,   // 0x46, F
       0x0e, 0x11, 0x10, 0x10, 0x13, 0x11, 0x0f,   // 0x37, G
       0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11,   // 0x48, H
       0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e,   // 0x49, I
       0x1f, 0x02, 0x02, 0x02, 0x02, 0x12, 0x0c,   // 0x4a, J
       0x11, 0x12, 0x14, 0x18, 0x14, 0x12, 0x11,   // 0x4b, K
       0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f,   // 0x4c, L
       0x11, 0x1b, 0x15, 0x11, 0x11, 0x11, 0x11,   // 0x4d, M
       0x11, 0x11, 0x19, 0x15, 0x13, 0x11, 0x11,   // 0x4e, N
       0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,   // 0x4f, O
       0x1e, 0x11, 0x11, 0x1e, 0x10, 0x10, 0x10,   // 0x50, P
       0x0e, 0x11, 0x11, 0x11, 0x15, 0x12, 0x0d,   // 0x51, Q
       0x1e, 0x11, 0x11, 0x1e, 0x14, 0x12, 0x11,   // 0x52, R
       0x0e, 0x11, 0x10, 0x0e, 0x01, 0x11, 0x0e,   // 0x53, S
       0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,   // 0x54, T
       0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,   // 0x55, U
       0x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04,   // 0x56, V
       0x11, 0x11, 0x11, 0x15, 0x15, 0x1b, 0x11,   // 0x57, W
       0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11,   // 0x58, X
       0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, 0x04,   // 0x59, Y
       0x1f, 0x01, 0x02, 0x04, 0x08, 0x10, 0x1f,   // 0x5a, Z
       0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e,   // 0x5b, [
       0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01,   // 0x5c, \
       0x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e,   // 0x5d, ]
       0x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00,   // 0x5e, ^
       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,   // 0x5f, _
       0x04, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00,   // 0x60, `
       0x00, 0x0e, 0x01, 0x0d, 0x13, 0x13, 0x0d,   // 0x61, a
       0x10, 0x10, 0x10, 0x1c, 0x12, 0x12, 0x1c,   // 0x62, b
       0x00, 0x00, 0x00, 0x0e, 0x10, 0x10, 0x0e,   // 0x63, c
       0x01, 0x01, 0x01, 0x07, 0x09, 0x09, 0x07,   // 0x64, d
       0x00, 0x00, 0x0e, 0x11, 0x1f, 0x10, 0x0f,   // 0x65, e
       0x06, 0x09, 0x08, 0x1c, 0x08, 0x08, 0x08,   // 0x66, f
       0x0e, 0x11, 0x13, 0x0d, 0x01, 0x01, 0x0e,   // 0x67, g
       0x10, 0x10, 0x10, 0x16, 0x19, 0x11, 0x11,   // 0x68, h
       0x00, 0x04, 0x00, 0x0c, 0x04, 0x04, 0x0e,   // 0x69, i
       0x02, 0x00, 0x06, 0x02, 0x02, 0x12, 0x0c,   // 0x6a, j
       0x10, 0x10, 0x12, 0x14, 0x18, 0x14, 0x12,   // 0x6b, k
       0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,   // 0x6c, l
       0x00, 0x00, 0x0a, 0x15, 0x15, 0x11, 0x11,   // 0x6d, m
       0x00, 0x00, 0x16, 0x19, 0x11, 0x11, 0x11,   // 0x6e, n
       0x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e,   // 0x6f, o
       0x00, 0x1c, 0x12, 0x12, 0x1c, 0x10, 0x10,   // 0x70, p
       0x00, 0x07, 0x09, 0x09, 0x07, 0x01, 0x01,   // 0x71, q
       0x00, 0x00, 0x16, 0x19, 0x10, 0x10, 0x10,   // 0x72, r
       0x00, 0x00, 0x0f, 0x10, 0x0e, 0x01, 0x1e,   // 0x73, s
       0x08, 0x08, 0x1c, 0x08, 0x08, 0x09, 0x06,   // 0x74, t
       0x00, 0x00, 0x11, 0x11, 0x11, 0x13, 0x0d,   // 0x75, u
       0x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04,   // 0x76, v
       0x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a,   // 0x77, w
       0x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11,   // 0x78, x
       0x00, 0x11, 0x11, 0x0f, 0x01, 0x11, 0x0e,   // 0x79, y
       0x00, 0x00, 0x1f, 0x02, 0x04, 0x08, 0x1f,   // 0x7a, z
       0x06, 0x08, 0x08, 0x10, 0x08, 0x08, 0x06,   // 0x7b, {
       0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x04,   // 0x7c, |
       0x0c, 0x02, 0x02, 0x01, 0x02, 0x02, 0x0c,   // 0x7d, }
       0x08, 0x15, 0x02, 0x00, 0x00, 0x00, 0x00,   // 0x7e, ~
       0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f}   // 0x7f, DEL
       };
     
    You only need a 1d array each element can be accessed by ((ASCII CODE - 0x20) * 7 ) As each char is 7 bits long...
     
  21. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    pls reply to post 56 also on hardware part....


    why*7?
     

Share This Page