20 final report

Upload: ganvendra-singh-chahar

Post on 10-Feb-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/22/2019 20 Final Report

    1/32

    TI India Analog Design Contest 2010

    1 Name of your college CHITKARA UNIVERSITY ,PUNJAB

    2 Team Number 20

    3 Name, contact numbers and e-mail ids of the Participants 1. NISHANT BANSAL(9915477088)

    ([email protected])2. PARVEEN BHATTI

    (9646454782)([email protected])\

    3. UMESH GOYAL(9463792985)

    ([email protected])4. RAVNEET SINGH

    (9041245366)([email protected])

    4 Name, contact number and email ID of mentor 1. Mr. AMIT MUNJAL(9417161518)

    ([email protected])2. Mrs. SHIVANI MALHOTRA

    (9501105623)([email protected])

    5 Title of the project Intelligent communication cumIdentification system

    6 CMT ID 52

  • 7/22/2019 20 Final Report

    2/32

    SELF ASSESSMENT

    1. Each member added to the objective by each contributing equally.

    Umesh Goyal - Hardware Designing, Testing

    Nishant Bansal - Software Designing, Project Report.

    Ravneet Singh - Project Report, Hardware Designing.

    Parveen Bhatti - Software Designing, Testing.

    2. We students of final year B.Tech/ECE, Chitkara Institute Of Engineering and Technology,

    Rajpura. With reference to our participation in TI ADC 2010, we hereby declare that our

    project report is submitted only to TI ADC 2010 and no other contest. In future also this

    report will not be used in any contest.

    3. Idea of our project is totally original. While working on this project, we searched for helping

    materials but did not come across any similar work. So inspiration is not from any earlier

    work, but projects like routing, video processing and transmission helped us in completing

    few steps of our project.

    4. Mr. Amit Munjal : Software designing, hardware designing and report editing.Mrs. Shivani Malhotra:- Hardware selection, report review, project testing and explained

    the domain of our project.

    5. First successful step was working of temperature sensor program. By first week of december

    text transmission was successful, image by the last week of december and video by second

    week of january. Real time video transmission was the next step from which real time video

    acquisition using matlab has been done.

    6.Non-technical challenges-

    Selection of TI components for project. Less prior knowledge of the ICs and controller used in project. Analog to digital convertors were received late, therefore not used.

    7. Technical challenges

    Unavailability of licensed version of IAR workbench.

    Difficulty in writing the matlab code for real time video acquisition using webcam.

    Faced difficulty in transmitting the encoded signal due to low data rates.

    End device linked randomly to different access points.

    End device continue to send message even when link is broken i.e. it do not modify its behavior.

    8. LEARNINGS

    Learned many new things like image processing and video acquisition toolbox in Matlab.

    Worked on new kit EZ430RF2500 and MSP430.

    Enhanced our programming skills and knowledge about hardware.

    Learned new softwares like IAR workbench and CC studio.

    Our project would have been much better if we would have received analog to digitalconvertors a little earlier. Moreover the voice and real time video transmission would havemade our project much better and a little closer to our fixed goal.

  • 7/22/2019 20 Final Report

    3/32

    10.

    Paper design of hardware Algorithm design

    Hardware implementation on breadboard Software simulation on simulator

    Hardware implementation on PCB Complete system working

    Hardware/Software Testing Short Video on Project

    Nishant Bansal

    Parveen Bhatti

    Umesh Goyal

    Ravneet Singh

    Names and signatures of student team members

  • 7/22/2019 20 Final Report

    4/32

    FINAL PROJECT REPORT

    1. Introduction

    1.1 Motivation

    Communication is the process of transmission of information from source todestination via dedicated link. Just transceivers are needed to exchange data at differentbandwidths, data rates etc. Inspite of powerful communication equipments, still errors arise,communication gets interrupted, errors are minimized but never removed fully. For exampleplane crash due to communication failure in air traffic controller and planes, shipwrecks, space

    shuttle accidents etc. Our project is a small to further minimize the errors in communicationThis project is an innovative idea feasible and helpful both from the point of view of

    social and technical problems. Project solves the problems like range limit of communicating

    device, preventing exchange of incomplete data, and mainly when the point to point link breaks.

    We fixed our goal to minimize the errors, interruption in communication by providing backup or

    we can say a bypass communication link in case of failure of main link.

    Factors like cost, power and performance are specially taken care of. In

    implementation, the power consumption is very less because the hardware used i.e ez430

    rf2500 communication kit is low power consuming, moreover range is short which is additional

    factor to prevent power wastage. Performance wise ez430 is a very efficient multipurpose kit

    high data rate, easily programmable, compatible with tools like IAR workbench and CC studiowhich provides a easy platform for project implementation. Discussing about the cost factor, we

    know every new technology is costly in beginning but gets cheaper when used widely. Same

    way this project also can be improved to decrease the cost.

    1.2 Technical Background

    Technical aspects of project are simple for implementation. The communication type is wireless

    and mainly line of sight.

    The wireless development tool of TI is ez430 rf2500 which has a range of 50m and can be

    easily programmed in C/C++ using IAR workbench and CC studio. The new controller MSP430

    is symbol of use new technology in project. Reason behind using RF is that it is not only easily

    available unlike busy FM bands, but also easy to handle unlike microwave which requires skilled

    workers to work on it, which further decreases the implementation cost. Overall RF serves the

    balancing factor from aspects like big size antennas in low frequency signals and high cost in

    case of high frequency signals.

  • 7/22/2019 20 Final Report

    5/32

    1.3 GOAL OF PROJECT

    In todays world most of the communication systems consists of

    transceivers which communicate via dedicated links. But might be a case of communication

    failure between them owing to any of the causes like range factor, obstacles in path of

    communication etc. To overcome this problem, we thought of a backup to provide uninterruptedcommunication. Technically a bypass for the exchanged information.

    Our project is an innovative idea which illustrates and emphasize upon method

    to complete the breaking communication links. Causes could be hardware failure, limited range

    of transceivers or maybe obstacles in the communication.

    ASSUMED INPUTS

    Imagine a dedicated communication between two transceivers. By providing best possible

    link, bandwidth etc it is assumed to have error free communication. But still if there is a failure

    i.e the link breaks, the information exchange stops. Here we used the range factor of ez430RF2500 to break the link for our project prototype. Experiment was to break the link between

    two devices and complete using third device.

    ASSUMED OUTPUTS

    Our expected output is the completed communication link and data transfer between end

    device and distant target board, but by using the bypass for the information i.e using the third

    transceiver which completes the link. All of the three end device, distant target board and

    intermediate target board are programmed to provide desired result. When link breaks between

    end device and distant target board, they automatically detects the third i.e intermediate target

    board to provide the bypass pathway for the data exchange. Result is uninterruptedcommunication.

    Here we have optimized the factors like faithful communication via dedicated bypass link in

    case of main link failure. Improved the range factor, if range is the reason for interruption, and

    reduced the power consumption by using low power consuming kits.

    LEVELS:

    To reveal the portability of project idea, we fixed six levels to achieve in our implementation.

    1. Temperature as analog data using temperature sensor ()

    2. Transmission of text.

    3. Transmission of Image.

    4. Transmission of voice.

    5. Transmission of video.

    6. Transmission of real time video.

    If all the six are transferred successfully according to the proposed solution. Then the project isfeasible and can be used economically.

  • 7/22/2019 20 Final Report

    6/32

    Let us go through examples to understand the project precisely.

    F.1 F.2

    F.3

    F.4 F.5

  • 7/22/2019 20 Final Report

    7/32

    EXAMPLE - 1

    Imagine the case of air traffic controller. First figure fig.1 describes the situation we talked about

    as a problem of our project.

    The planes p2 and p3 are out of range of air traffic controller, but plane p1 in continuous link.Now as illustrated in fig.2, if there is much traffic, the case of plane crash is obvious as shown in

    fig.3.

    Now, think of the solution proposed by our project. If communication break is overcome by

    plane p2 and p3 by completing the link via plane p1 as in fig.4, the situation is much better. The

    safe communication results in safe traffic control i.e a safe passage of planes in traffic as in

    fig.5.

    From the last two decades the mid air collisions are very commonly heard accidents, reason

    being the communication failure between plane and air traffic controller. But our project is one of

    the precautionary measures which can solve such problems.

    EXAMPLE - 2

  • 7/22/2019 20 Final Report

    8/32

    2. PROPOSED SOLUTION

    In simple language the solution for the breaking communication link is to have some

    other link as substitute. Solution is effective if new link is more powerful and similar to the old

    link.

    So, implementing the solution with RF2500 kit was a little tricky. We used three

    RF2500 kits for prototype example. First was access point connected with laptop, second and

    third were the end devices with battery board at distant place. When link between access point

    and target board breaks getting out of range, the third end device completes the link by getting

    in range of both access device and target board. Hence data transfers successfully.

    WHAT IS NEW?

    The new thing is the solution of problem just by changing path of communication without

    replacing existing system. The plus point is, it can be implemented easily on the existing

    systems with minor modifications in the hardware and code.

    CLEVER IMPLEMENTATION

    Normally communication is exchange of information between source and destination via

    media. Ours is also the same but with minor modification which adds an additional

    feature to it. Modified hardware and program adds a feature of completing the

    communication link with the main device through subordinate devices nearby. Neither

    new hardware required nor any replacement, still the renewed uninterrupted

    communication is set up.

    BLOCK DIAGRAM

  • 7/22/2019 20 Final Report

    9/32

    3. IMPLEMENTATION

  • 7/22/2019 20 Final Report

    10/32

  • 7/22/2019 20 Final Report

    11/32

    In the above flow chart the first column shows the initialization of the network which is common

    to both temperature sensor and text transmission as shown in second and third columnrespectively.

  • 7/22/2019 20 Final Report

    12/32

    The above flow chart depicts the algorithm of image and video transmission.

  • 7/22/2019 20 Final Report

    13/32

    Component TI/NonTI

    Quantity Total cost ofcomponent

    TI Supplied/Purchased

    1 MSP430f2274 TI 6 TI supplied

    2 Tmp100na/250 TI 6 TI supplied3 Cc2500 TI 6 TI supplied

    Total cost of the project Approx 150$

    5. Results

  • 7/22/2019 20 Final Report

    14/32

    6. CONCLUSION

    Our goal was to achieve the above mentioned six levels using our proposed solution.

    Among them temperature, text, image and video are transferred successfully. But voice and real

    time video is yet to be transferred. We are still working for it.

    STRENGTH:

    1. No new hardware is required.

    2. Minor modification of the code.

    3. Can be implemented on all the communication devices.

    4. Implementation possible mobile (moving) devices also.

    5. Advancements is easy.

    6. Can be used commercially.

    LIMITATIONS

    1. Not applicable on wired connections.

    2. Practiced only on RF.

    3. Limited to range of few meters.

    FUTURE SCOPE

    As we mentioned already, our project is an innovative idea. So, if this idea is worked on,

    then it can be improved and used for long range communication also.

    Our project is just a prototype, its advanced version can be used commercially in areas

    like-: Aerospace, Military and cellular communication etc.

    7. REFERENCES

    1. www.ti.com

    2. www.e2e.ti.com

    3. http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2500.html

    4. http://www.mathworks.com/

    5. CC2500 Datasheet Low-Cost Low-Power 2.4 GHz RF Transceiver (Rev. B)

    6. eZ430-RF2500 Development Tool User's Guide (Rev. C)

    APPENDIX

    CODE FOR ACCESS POINT OF

    # "."

    # "."

    # "."

    # "."

    # "."

    # "."

    # "."

    # "."

    # "430224."

    # "."

  • 7/22/2019 20 Final Report

    15/32

    # MESSAGELENGTH 3

    TXS( * , );

    MCUI();

    D( , , [MESSAGELENGTH );

    DS( [4, [3, [MESSAGELENGTH);

    RA();

    // [ = "\\\\ ****\\ **** Z430RF2500\\ **********

    T S N\\********///**** C 2007\\ ******////***** T I I\\ **

    ***(/***** A .\\ ********* V 1.02\\ *****\\ ***\\ \\";

    O @ 010F4; // T

    FA[4 @ 010F0; // F

    // L ID

    ID LID[NUMCONNECTIONS;

    8 NCP;

    //

    8 CB(ID);

    //

    8 PFS;

    8 JS;

    8 SMS;

    // = , F =

    M = 1;

    CM = 0;

    ()

    A;

    IS S;

    WDTCTL = WDTPW + WDTHOLD; // S WDT

    // STI DCO// T ,

    // .

    ;

    ( = 0; < 0FFFF; ++)

    ( CALBC18MHZ == 0FF ) // D

    ;

    P1DIR = 003;

    BSPTURNONLED1();

    BSPTURNOFFLED2();

    (1)

    ( = 0; < 05FFF; ++)

    BSPTOGGLELED2();BSPTOGGLELED1();

    BSPI();

    ( FA[0 == 0FF &&

    FA[1 == 0FF &&

    FA[2 == 0FF &&

    FA[3 == 0FF )

    RA(); // R

    A.[0=FA[0;

    A.[1=FA[1;A.[2=FA[2;

    A.[3=FA[3;

  • 7/22/2019 20 Final Report

    16/32

    SMPLI(IOCTLOBJADDR, IOCTLACTSET, &A);

    MCUI();

    //T

    TXS( (*), );

    TXS( "\\I N....", 26 );

    SMPLI(CB);

    //

    TXS( "D\\", 6);

    //

    (1)

    // W J J

    // E D.

    (JS && (NCP < NUMCONNECTIONS))

    //

    SMPLLL(&LID[NCP);

    NCP++;

    BSPENTERCRITICALSECTION(S);

    (JS)

    JS;

    BSPEXITCRITICALSECTION(S);

    // ...

    (SMS)

    [6;

    [ = "HUB0";

    [ = "000";

    C, ;

    ; [2;

    ADC10CTL1 = INCH10 + ADC10DIV4; // T S ADC10CLK/5

    ADC10CTL0 = SREF1 + ADC10SHT3 + REFON + ADC10ON + ADC10IE + ADC10SR;

    ( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

    [0 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL1 = INCH11; // AV/2

    ADC10CTL0 = SREF1 + ADC10SHT2 + REFON + ADC10ON + ADC10IE + REF25V;

    ( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S SR(CPUOFF + GIE); // LPM0

    [1 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL0 &= (REFON + ADC10ON); // A/D

    // C = ((A10/1024)*1500V)986V)*1/3.55V = A10*423/1024 278

    // 32.1 = 321

    // 4230 423

    = [0;

    C = ((( 673) * 4230) / 1024);

    ( O != 0FFFF )

    C += O;

    = [1;

    = (*25)/512;

  • 7/22/2019 20 Final Report

    17/32

    [0 = C&0FF;

    [1 = (C>>8)&0FF;

    [2 = ;

    DS(, , );

    BSPTOGGLELED1();

    SMS = 0;

    // H ED ?

    // N '

    (PFS)

    8 [MAXAPPPAYLOAD, , ;

    //

    (=0; >8) & 0FF;FA[1= & 0FF;

    FA[2=(2>>8) & 0FF;

    FA[3=2 & 0FF;

    FCTL1 = FWKEY; // C WRT

    FCTL3 = FWKEY + LOCKA + LOCK; // S LOCK & LOCKA

    /*

    *

    */

    D( , , [MESSAGELENGTH )

    S[4;

    S[3; ;

  • 7/22/2019 20 Final Report

    18/32

    S[0 = '0';

    S[1 = '0';

    S[2 = '0'+(((+1)/10)%10);

    S[3 = '0'+((+1)%10);

    = ( ) ;

    = +128;

    = (*100)/256;

    S[0 = '0'+(%10);S[1 = '0'+((/10)%10);

    S[2 = '0'+((/100)%10);

    DS( S, S, );

    /*

    *

    */

    DS( [4, [3, [MESSAGELENGTH )

    [ = " XX.XC";

    = [0 + ([1

  • 7/22/2019 20 Final Report

    19/32

    [8 = [0;

    [9 = [1;

    [10 = [2;

    [11 = [3;

    [12 = [4;

    [13 = [5;

    [15 = '0'+([2/10)%10;

    [17 = '0'+([2%10);

    [3 = [0;

    [4 = [1;

    [5 = [2;

    [6 = [3;

    TXS(, );

    /*

    *

    */

    TXS( * , )

    ;

    ( = 0; < ; ++)

    ;

    UCA0TXBUF = [;

    (!(IFG2&UCA0TXIFG)); // USCIA0 TX ?

    /*

    *

    */

    MCUI()

    BCSCTL1 = CALBC18MHZ; // S DCO

    DCOCTL = CALDCO8MHZ;

    BCSCTL3 = LFXT1S2; // LFXT1 = VLO

    TACCTL0 = CCIE; // TACCR0

    TACCR0 = 12000; // 1

    TACTL = TASSEL1 + MC1; // ACLK,

    P3SEL = 030; // P3.4,5 = USCIA0 TXD/RXD

    UCA0CTL1 = UCSSEL2; // SMCLK

    UCA0BR0 = 041; // 9600 8M

    UCA0BR1 = 03;

    UCA0MCTL = UCBRS2;

    UCA0CTL1 &= UCSWRST; // **I USCI **

    IE2 = UCA0RXIE; // E USCIA0 RX

    ();

    /*

    * R ISR . R

    * ISR .

    */

    8 CB(ID )

    ()

    PFS++;

    JS++;

    // . 0;

  • 7/22/2019 20 Final Report

    20/32

    /*

    * ADC10

    */

    # =ADC10VECTOR

    ADC10ISR()

    SR(CPUOFF); // C CPUOFF 0(SR)

    /*

    * T A0

    */

    # =TIMERA0VECTOR

    TA ()

    SMS = 1;

    /*

    * USCIA

    */

    # =USCIAB0RXVECTOR

    USCI0RXISR()

    = UCA0RXBUF;

    ( == 'V' == '' )

    M = 1;

    ( == 'M' == '' )

    M = 0;

    ( == 'F' == '' )

    CM = 0;

    ( == 'C' == '' )

    CM = 1;

    CODE FOR END DEVICE OF

    # "."

    # "."

    # "."

    # "."

    # "."

    # "."

    # "."

    T(); MCUI();

    O @ 010F4; // T

    FA[4 @ 010F0; // F

    RA();

    ()

    A;

    WDTCTL = WDTPW + WDTHOLD; // S WDT

    // STI DCO

    // T ,

    // . ;

    ( = 0; < 0FFFF; ++)

  • 7/22/2019 20 Final Report

    21/32

    ( CALBC18MHZ == 0FF ) // D

    ;

    P1DIR = 003;

    BSPTURNONLED1();

    BSPTURNOFFLED2();

    (1)

    ( = 0; < 05FFF; ++)

    BSPTOGGLELED2();

    BSPTOGGLELED1();

    // STI

    P1DIR = 0FF;

    P1OUT = 000;

    P2DIR = 027;

    P2OUT = 000;

    P3DIR = 0C0;

    P3OUT = 000;

    P4DIR = 0FF;

    P4OUT = 000;

    BSPI();

    ( FA[0 == 0FF &&

    FA[1 == 0FF &&

    FA[2 == 0FF &&

    FA[3 == 0FF )

    RA(); // R

    A.[0=FA[0;

    A.[1=FA[1;

    A.[2=FA[2;

    A.[3=FA[3;

    SMPLI(IOCTLOBJADDR, IOCTLACTSET, &A);BCSCTL1 = CALBC18MHZ; // S DCO

    DCOCTL = CALDCO8MHZ;

    BCSCTL3 = LFXT1S2; // LFXT1 = VLO

    TACCTL0 = CCIE; // TACCR0

    TACCR0 = 12000; // 1

    TACTL = TASSEL1 + MC1; // ACLK,

    // . LEDS

    // . LED3 LED 4 EXP

    // . LED1 .

    (SMPLNOJOIN == SMPLI((8 (*)(ID))0))

    BSPTOGGLELED1();

    BSPTOGGLELED2();;SR(LPM3 + GIE); // LPM3

    // AP .

    T();

    RA()

    , 2;

    = TIRIFVLO(); // 000 0FF

    ( ( & 0FF00)==0FF00 ( & 0FF00)==00000 );

    2 = TIRIFVLO();

    BCSCTL1 = CALBC11MHZ; // S DCO 1MH

  • 7/22/2019 20 Final Report

    22/32

    DCOCTL = CALDCO1MHZ;

    FCTL2 = FWKEY + FSSEL0 + FN1; // MCLK/3 F T G

    FCTL3 = FWKEY + LOCKA; // C LOCK & LOCKA

    FCTL1 = FWKEY + WRT; // S WRT

    FA[0=(>>8) & 0FF;

    FA[1= & 0FF;

    FA[2=(2>>8) & 0FF;FA[3=2 & 0FF;

    FCTL1 = FWKEY; // C WRT

    FCTL3 = FWKEY + LOCKA + LOCK; // S LOCK & LOCKA

    T()

    ID ID1;

    8 [3;

    // ...

    (SMPLSUCCESS != SMPLL(&ID1))

    SR(LPM3 + GIE); // LPM3

    BSPTOGGLELED1();

    BSPTOGGLELED2();

    // T LED

    (BSPLED1ISON())

    BSPTOGGLELED1();

    (BSPLED2ISON())

    BSPTOGGLELED2();

    (1)

    ; C, ;

    [2;

    SMPLI( IOCTLOBJRADIO, IOCTLACTRADIOSLEEP, "" );

    SR(LPM3+GIE); // LPM3

    SMPLI( IOCTLOBJRADIO, IOCTLACTRADIOAWAKE, "" );

    BSPTOGGLELED2();

    ADC10CTL1 = INCH10 + ADC10DIV4; // T S ADC10CLK/5

    ADC10CTL0 = SREF1 + ADC10SHT3 + REFON + ADC10ON + ADC10IE + ADC10SR;

    ( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

    [0 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL1 = INCH11; // AV/2

    ADC10CTL0 = SREF1 + ADC10SHT2 + REFON + ADC10ON + ADC10IE + REF25V;

    ( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

    [1 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL0 &= (REFON + ADC10ON); // A/D

    // C = ((A10/1024)*1500V)986V)*1/3.55V = A10*423/1024 278

    // 32.1 = 321

    // 4230 423

    = [0;

    C = (( 673) * 4230) / 1024;( O != 0FFFF )

  • 7/22/2019 20 Final Report

    23/32

    C += O;

    /* , UB = B, LB = B

    C LB C UB LB

    0 1 2

    */

    = [1;

    = (*25)/512;

    [0 = C&0FF;

    [1 = (C>>8)&0FF;

    [2 = ;

    (SMPLSUCCESS == SMPLS(ID1, , ()))

    BSPTOGGLELED2();

    BSPTOGGLELED2();

    BSPTOGGLELED1();

    /*

    * ADC10

    */

    # =ADC10VECTOR

    ADC10ISR()

    SR(CPUOFF); // C CPUOFF 0(SR)

    /*

    * T A0

    */# =TIMERA0VECTOR

    TA ()

    SR(LPM3); // C LPM3 0(SR)

    CODE FOR

    # "."

    # "."

    # "."

    # "."# "."

    # "."

    # "."

    # "."

    # "430224."

    # "."

    # MESSAGELENGTH 3

    TXS( * , );

    MCUI();

    T();

    D( , , [MESSAGELENGTH );

    DS( [4, [3, [MESSAGELENGTH);

    RA();

    [ = "\\\\ ****\\ **** Z430RF2500\\ **********

    T S N\\********///**** C 2007\\ ******////***** T I I\\ *****(/***** A .\\ ********* V 1.02\\ *****\\ ***\\ \\";

    O @ 010F4; // T

  • 7/22/2019 20 Final Report

    24/32

    FA[4 @ 010F0; // F

    ID LID[NUMCONNECTIONS;

    8 NCP;

    8 CB(ID);

    8 PFS;

    8 JS;

    8 SMS;

    M = 1; CM = 0;

    ()

    A;

    IS S;

    WDTCTL = WDTPW + WDTHOLD; // S WDT

    ;

    ( = 0; < 0FFFF; ++)

    ( CALBC18MHZ == 0FF ) // D

    ;

    P1DIR = 003;

    BSPTURNONLED1();

    BSPTURNOFFLED2();

    (1)

    ( = 0; < 05FFF; ++)

    BSPTOGGLELED2();

    BSPTOGGLELED1();

    P1DIR = 0FF;

    P1OUT = 000;

    P2DIR = 027;

    P2OUT = 000;

    P3DIR = 0C0;

    P3OUT = 000;

    P4DIR = 0FF;

    P4OUT = 000;

    BSPI();

    ( FA[0 == 0FF &&FA[1 == 0FF &&

    FA[2 == 0FF &&

    FA[3 == 0FF )

    RA(); // R

    A.[0=FA[0;

    A.[1=FA[1;

    A.[2=FA[2;

    A.[3=FA[3;

    SMPLI(IOCTLOBJADDR, IOCTLACTSET, &A);

    MCUI();

    TXS( (*), );TXS( "\\I N....", 26 );

    SMPLI(CB);

    TXS( "D\\", 6);

    BCSCTL1 = CALBC18MHZ; // S DCO

    DCOCTL = CALDCO8MHZ;

    BCSCTL3 = LFXT1S2; // LFXT1 = VLO

    TACCTL0 = CCIE; // TACCR0

    TACCR0 = 12000; // 1

    TACTL = TASSEL1 + MC1; // ACLK,

    (SMPLNOJOIN == SMPLI((8 (*)(ID))0))

    BSPTOGGLELED1();

    BSPTOGGLELED2();;

    SR(LPM3 + GIE); // LPM3

    T();

  • 7/22/2019 20 Final Report

    25/32

    RA()

    , 2;

    = TIRIFVLO(); // 000 0FF

    ( ( & 0FF00)==0FF00 ( & 0FF00)==00000 );2 = TIRIFVLO();

    BCSCTL1 = CALBC11MHZ; // S DCO 1MH

    DCOCTL = CALDCO1MHZ;

    FCTL2 = FWKEY + FSSEL0 + FN1; // MCLK/3 F T G

    FCTL3 = FWKEY + LOCKA; // C LOCK & LOCKA

    FCTL1 = FWKEY + WRT; // S WRT

    FA[0=(>>8) & 0FF;

    FA[1= & 0FF;

    FA[2=(2>>8) & 0FF;

    FA[3=2 & 0FF;

    FCTL1 = FWKEY; // C WRT

    FCTL3 = FWKEY + LOCKA + LOCK; // S LOCK & LOCKA

    T()

    ID ID1;

    8 [3;

    // ...

    (SMPLSUCCESS != SMPLL(&ID1))

    SR(LPM3 + GIE); // LPM3

    BSPTOGGLELED1();

    BSPTOGGLELED2();

    // T LED (BSPLED1ISON())

    BSPTOGGLELED1();

    (BSPLED2ISON())

    BSPTOGGLELED2();

    (1)

    ;

    C, ;

    [2;

    SMPLI( IOCTLOBJRADIO, IOCTLACTRADIOSLEEP, "" );

    SR(LPM3+GIE); // LPM3 SMPLI( IOCTLOBJRADIO, IOCTLACTRADIOAWAKE, "" );

    BSPTOGGLELED2();

    ADC10CTL1 = INCH10 + ADC10DIV4; // T S ADC10CLK/5

    ADC10CTL0 = SREF1 + ADC10SHT3 + REFON + ADC10ON + ADC10IE + ADC10SR;

    ( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

    [0 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL1 = INCH11; // AV/2

    ADC10CTL0 = SREF1 + ADC10SHT2 + REFON + ADC10ON + ADC10IE + REF25V;

    ( C = 240; C > 0; C ); // ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

  • 7/22/2019 20 Final Report

    26/32

    [1 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL0 &= (REFON + ADC10ON); // A/D

    // C = ((A10/1024)*1500V)986V)*1/3.55V = A10*423/1024 278

    // 32.1 = 321

    // 4230 423

    = [0;C = (( 673) * 4230) / 1024;

    ( O != 0FFFF )

    C += O;

    /* , UB = B, LB = B

    C LB C UB LB

    0 1 2

    */

    = [1;

    = (*25)/512;

    [0 = C&0FF;

    [1 = (C>>8)&0FF;

    [2 = ;

    (JS && (NCP < NUMCONNECTIONS))

    IS S;

    //

    SMPLLL(&LID[NCP);

    NCP++;

    BSPENTERCRITICALSECTION(S);

    (JS)

    JS;

    BSPEXITCRITICALSECTION(S);

    // ...

    (SMS)

    [6;

    [ = "HUB0";

    [ = "000";

    C, ;

    ;

    [2;

    ADC10CTL1 = INCH10 + ADC10DIV4; // T S ADC10CLK/5

    ADC10CTL0 = SREF1 + ADC10SHT3 + REFON + ADC10ON + ADC10IE + ADC10SR;( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

    [0 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL1 = INCH11; // AV/2

    ADC10CTL0 = SREF1 + ADC10SHT2 + REFON + ADC10ON + ADC10IE + REF25V;

    ( C = 240; C > 0; C ); //

    ADC10CTL0 = ENC + ADC10SC; // S

    SR(CPUOFF + GIE); // LPM0

    [1 = ADC10MEM;

    ADC10CTL0 &= ENC;

    ADC10CTL0 &= (REFON + ADC10ON); // A/D = [0;

    C = ((( 673) * 4230) / 1024);

  • 7/22/2019 20 Final Report

    27/32

    ( O != 0FFFF )

    C += O;

    = [1;

    = (*25)/512;

    [0 = C&0FF;

    [1 = (C>>8)&0FF;

    [2 = ;

    DS(, , );

    BSPTOGGLELED1();

    SMS = 0;

    (PFS)

    8 [MAXAPPPAYLOAD, , ;

    (=0;

  • 7/22/2019 20 Final Report

    28/32

    [0 = '0'+((/1000)%10);

    [4 = '0'+(%10);

    [2 = '0'+((/10)%10);

    [1 = '0'+((/100)%10);

    ( M )

    [ = "\\N:XXXX,T:XX.XC,B:X.XV,S:XXX%,RE: ";

    [46 = [2;[47 = [1;

    [48 = [0;

    [17 = [0;

    [18 = [1;

    [19 = [2;

    [20 = [3;

    [21 = [4;

    [22 = [5;

    [32 = '0'+([2/10)%10;

    [34 = '0'+([2%10);

    [7 = [0;

    [8 = [1;

    [9 = [2;

    [10 = [3;

    TXS(, );

    [ = "\\$ADDR,XX.XC,V.C,RSI,N#";

    [19 = [2;

    [20 = [1;

    [21 = [0;

    [8 = [0;

    [9 = [1;

    [10 = [2;

    [11 = [3;

    [12 = [4;

    [13 = [5;

    [15 = '0'+([2/10)%10;

    [17 = '0'+([2%10);

    [3 = [0;[4 = [1;

    [5 = [2;

    [6 = [3;

    TXS(, );

    TXS( * , )

    ;

    ( = 0; < ; ++)

    ;

    UCA0TXBUF = [;

    (!(IFG2&UCA0TXIFG)); // USCIA0 TX ?

    MCUI()

    BCSCTL1 = CALBC18MHZ; // S DCO

    DCOCTL = CALDCO8MHZ;

    BCSCTL3 = LFXT1S2; // LFXT1 = VLO

    TACCTL0 = CCIE; // TACCR0

    TACCR0 = 12000; // 1

    TACTL = TASSEL1 + MC1; // ACLK,

    P3SEL = 030; // P3.4,5 = USCIA0 TXD/RXD

    UCA0CTL1 = UCSSEL2; // SMCLK

    UCA0BR0 = 041; // 9600 8M

    UCA0BR1 = 03;

    UCA0MCTL = UCBRS2;

    UCA0CTL1 &= UCSWRST; // **I USCI **IE2 = UCA0RXIE; // E USCIA0 RX

    ();

  • 7/22/2019 20 Final Report

    29/32

    8 CB(ID )

    ()

    PFS++;

    JS++;

    0;

    # =ADC10VECTOR

    ADC10ISR()

    SR(CPUOFF); // C CPUOFF 0(SR)

    # =TIMERA0VECTOR

    TA ()

    SMS = 1;

    # =USCIAB0RXVECTOR

    USCI0RXISR()

    = UCA0RXBUF;

    ( == 'V' == '' )

    M = 1;

    ( == 'M' == '' )

    M = 0;

    ( == 'F' == '' )

    CM = 0;

    ( == 'C' == '' )

    CM = 1;

    CODE FOR

    # "/1/."

    # "."

    8 =0;

    P TS;

    ()

    BSPI();

    MRFII();

    P3SEL = 030; // P3.4,5 = USCIA0 TXD/RXD

    UCA0CTL1 = UCSSEL2; // SMCLK

    UCA0BR0 = 041; // 9600 8M

    UCA0BR1 = 03;

    UCA0MCTL = UCBRS2;

    UCA0CTL1 &= UCSWRST; // I USCI

    IE2 = UCA0RXIE; // E USCIA0 RX

    MRFIWU();

    MRFIRO();

    =0;

    SR(GIE+LPM4);

    MRFIRCISR()

    8 ;

  • 7/22/2019 20 Final Report

    30/32

    P1OUT = 002;

    P ;

    MRFIR(&);

    [ = " " ;

    (=1;

  • 7/22/2019 20 Final Report

    31/32

    (:,:,2) =

    49 38 48

    22 15 39

    (:,:,3) =

    23 12 19

    0 0 10" ;

    (=1;

  • 7/22/2019 20 Final Report

    32/32

    = SOF(O, , )

    1 = .;

    AC(O, , )

    (., 'S','A');

    =0;

    =1;==1

    =1;

    ('A...' );

    ==1

    =0;

    (.,'S','DA');

    ('DA...');

    (1)

    PC(O, , )

    =1;

    = ('',1);

    (,'TR' ,I);

    .RCS= ''

    ();

    ==1

    = (,1);

    = (:,:,:,1);

    ()

    ()

    ()

    ('E')

    C(O, , )

    = 0;

    (.L(1:8),)

    SC(O, , )

    = 0;

    (.L(1:8),)

    SAMPLE MATLAB CODE FOR

    X1=('01.');

    X2=('02.');

    X3=('03.');

    X=[X1 X2 X3;

    1 = 2(X1);

    2 = 2(X2);

    3 = 2(X3);

    =1:20

    F()=1;

    G()=2;

    H()=3;

    =([F G H,10);

    2('','')