This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with code to test pin output on EZ430-RF2500

Other Parts Discussed in Thread: CC2500

hi, i using the ez430-rf2500 target board to measure the voltage of a solar panel and control a mppt circuit.

i have been trying to test the output of the target board pins by using the following code without success.

i do understand that i'll have to set the direction of the port to digital output first and then give it a high signal.

here is my code using ccs v4:

 

void main(void)

{

// INITIALISE BOARD

    halBoardInit();

 

// RESET RF-CHIP CC2500

    halRfResetChip();

 

// POWER DOWN CC2500

    halRfStrobe(CC2500_SPWD);

    

// STOP WATCHDOG TIMER

WDTCTL = WDTPW + WDTHOLD;                 

 

// RESET PORTS

P3DIR = 0xFF;                             // All P3.x outputs

P3OUT = 0;                                 // All P3.x reset

P4DIR = 0xFF;                             // All P4.x outputs

P4OUT = 0;                                 // All P4.x reset

 

   while(1)

   {   

    P4OUT |= 0x08;                       // ON P4.3                   

    P4OUT |= 0x10;                       // ON P4.4

    P4OUT |= 0x20;                       // ON P4.5

    P4OUT |= 0x40;                       // ON P4.6

    P3OUT |= 0x04;                       // ON P3.2   

    P3OUT |= 0x08;                       // ON P3.3

    P3OUT |= 0x01;                       // ON P3.0

    P3OUT |= 0x02;                       // ON P3.1

   

   }

}

i managed to get 6 out of the pins to display a high output but 3.2 and 3.3 still registered a low output.

can someone help me with this?

thanks!

  • Is there a reason you are using Port 3 rather than Port 2?  I bring this up because the signals associated with Port 3 are also going to the on board CC2500 device for the SPI interface.  This would seem to potentially create a confict.

    However, the Port 2 signals [4:0] are available on the test points on the side of the board and are not used anywhere else on the RF2500T radio target board.

    See schematics on page 18 of the eZ430-RF2500 Development Tool User's Guide (SLAU227).

  • Hi Karl,

    this schould give you high on all output pins (P3 to P14 of the available I/O on the eZ430-RF2500T). It will also light up the green and red LED.

        /* Port 1 Output Register */
        P1OUT = BIT0 + BIT1;
       
        /* Port 1 Direction Register */
        P1DIR = BIT0 + BIT1;
       
        /* Port 1 Interrupt Edge Select Register */
        P1IES = 0;
       
        /* Port 1 Interrupt Flag Register */
        P1IFG = 0;
       
        /* Port 2 Output Register */
        P2OUT = BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT6 + BIT7;
       
        /* Port 2 Port Select Register */
        P2SEL = 0;
       
        /* Port 2 Port Select Register */
        P2SEL &= ~BIT6;
       
        /* Port 2 Port Select Register */
        P2SEL &= ~BIT7;
       
        /* Port 2 Direction Register */
        P2DIR = BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT6 + BIT7;
       
        /* Port 2 Interrupt Edge Select Register */
        P2IES = 0;
       
        /* Port 2 Interrupt Flag Register */
        P2IFG = 0;
       
        /* Port 3 Output Register */
        P3OUT = 0;
       
        /* Port 4 Output Register */
        P4OUT = BIT3 + BIT4 + BIT5 + BIT6;
       
        /* Port 4 Direction Register */
        P4DIR = BIT3 + BIT4 + BIT5 + BIT6;

     

    Extra care needs to be taken in case of P2.6 and P2.7. They must be configure to I/O mode. Have a look at the data sheet for details.

    I did not configure P3 and any of the unconnected pins!

    Rgds
    aBUGSworstnightmare

**Attention** This is a public forum