c programming for msp430

Discussion in 'Homework Help' started by Parii, Feb 4, 2014.

  1. Parii

    Thread Starter New Member

    Feb 4, 2014
    1
    0
    Hello,

    i am working right now on the minilogger product. My job is to convert it processor from c8051 controller to msp430.code for c8051 controller i have reffered & found a doubt on 7segment display code.i know its basic code but the programmer has added one file named VTEnglish.h that i dont understand.
    here i m giving its snap shot.

    unsigned char code VTmsg_short[] = //As per this SW. Partly STD
    {
    //Parameter Data Address Range
    " SV" //0000 HiLt~LoLt
    " DP" //001A 0000/000.0/00.00/0.000 (English code)
    "UNIT" //0019 ? / ? / ENG (English code)
    };

    unsigned char code ASCVs7Seg_codes[] = //As per this SW. Partly STD
    {
    0x00, //20H (space) <-- index starts with 0. So subtract 20h first. blank for unresolved CHAR
    0x00, //21H !
    0x00, //22H "
    0x00, //23H #
    0x00, //24H $
    0x00, //25H %
    0x00, //26H &
    0x00, //27H '
    0x00, //28H (
    0x00, //29H )

    0x00, //2AH *
    0x00, //2BH +
    0x00, //2CH ,
    0x40, //2DH -
    0x00, //2EH
    0x00, //2FH /

    0x3f, //30H 0<-- index starts with 0. So subtract 30h first. blank for unresolved CHAR
    0x06, //31H 1
    0x5b, //32H 2
    0x4f, //33H 3
    0x66, //34H 4
    0x6d, //35H 5
    0x7d, //36H 6
    0x07, //37H 7
    0x7f, //38H 8
    0x6f, //39H 9

    0x00, //3AH :
    0x00, //3BH ;
    0x00, //3CH <
    0x00, //3DH =
    0x00, //3EH >
    0x00, //3FH ?
    0x00, //40H @

    0x77, //41H A
    0x7C, //42H B*
    0x39, //43H C
    0x5E, //44H D*
    0x79, //45H E
    0x71, //46H F
    0x3D, //47H G
    0x76, //48H H
    0x0F, //49H I
    0x1F, //4AH J
    0x76, //4BH K*
    0x38, //4CH L
    0x37, //4DH M
    0x54, //4EH N*
    0x5C, //4FH O*
    0x73, //50H P
    0x00, //51H Q*
    0x31, //52H R
    0x6D, //53H S
    0x78, //54H T*
    0x3E, //55H U
    0x3E, //56H V SAME AS U
    0x00, //57H W*
    0x00, //58H X*
    0x6E, //59H Y
    0x5B, //5AH Z
    0x00, //5BH [
    /* 0x00, //5CH \
    0x00, //5DH ]
    0x00, //5EH ^
    0x00, //5FH _
    0x00, //60H '

    0x00, //EXTRA

    0x00, //61H a*
    0x7C, //62H b
    0x5D, //63H c
    0x5E, //64H d
    0x7B, //65H e*
    0x00, //66H f*
    0x00, //67H g*
    0x74, //68H h
    0x00, //69H i*
    0x00, //6AH j*
    0x00, //6BH k*
    0x00, //6CH l*
    0x00, //6DH m*
    0x54, //6EH n
    0x5C, //6FH o
    0x00, //70H p*
    0x00, //71H q*
    0x50, //72H r
    0x6D, //73H s*
    0x78, //74H t
    0x1C, //75H u
    0x00, //76H v*
    0x00, //77H w*
    0x00, //78H x*
    0x00, //79H y*
    0x00, //7AH z*

    0x00, //7BH {
    0x00, //7CH |
    0x00, //7DH }
    0x00, //7EH ~
    0x00 //7FH (del)*/

    };


    & in main file where this is used is like this,,,

    void disp_menu()
    {
    B2R4 = (vt_address) * 4;
    for(B2R5=0;B2R5<4;B2R5++)
    {
    disp_m4[3-B2R5] = ASCVs7Seg_codes[VTmsg_short[B2R4 + B2R5]-0x20];
    }
    }

    here vt_address=0;
    & another time wen its used with vt_address=1;
    for display i am using Total 8 digit display--> 4 digit as upper & 4 digit as lower display

    kindly give your suggestions if any
    thank u
     
Loading...