hsmoke detector connected to ED at P2.0 ?..Please Help

Discussion in 'Embedded Systems and Microcontrollers' started by dorina, Jul 12, 2011.

  1. dorina

    Thread Starter New Member

    Jul 3, 2011
    Hello, I have to do a project using TI Ez430 rf2500 kit with msp430f2274uc..,from the start I want so say that I am new with microcontrollers and C but i am willing to learn.
    I want to do a project with a smoke detector which gives a ttl signal to the END DEVICE(0L for detecting smoke),I want to put this signal to port P2.0 at pin 3, and transmit it to ACCESS POINT,where I have set P2.0. as an output so it can give a signal that can trigger a buzzer.
    i succeeded in making the wireless communication between AP and ED using an interrupt at port1 by pressing the button on ED and blinking the red led on AP and triggering the buzzer.
    Now..I understood that only port1 and 2 have interrupt capability..but there is a problem in using an interrupt at port 2 because in mrfi.boards.c is defined BSP_ISR_FUNCTION which defines a Port2 interrupt service routine and I have defined another Port2 ISR in my code..so it didn't work..
    I have read in some posts that if I comment the BSP_ISR_FUNCTION from mrfi.boards.c it can work my ISR defined at port 2 from my ED.c file ..but it didn't..,I mean when I power up the device it stays like in an interrupt with red led on..only
    And if I put my ISR in mrfi.boards.c , like in the code below,I have the the green led on(which I want,it says no interrupt happenened,even if it doesn't toggle)but in the same time red led on,even if I don't put the signal from the smoke detector(my smoke detector gives a 0L when smoke was detected at P2.0)and when I put the signal at P2.0 nothing happens,no toggle..nothing.
    Code for ED :
    #include "msp430x22x4.h"
    #include "mrfi.h"
    unsigned int i;
    void main(void)
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
    P1DIR = 0x03; // P1.0-P1.1 as output


    BCSCTL3 |= LFXT1S_2;

    {P1OUT ^=0x02;//toggle green

    void MRFI_RxCompleteISR()
    P1OUT ^= 0x01;//toggle red

    And my modification in mrfi.boards.c :

    #pragma vector=PORT2_VECTOR
    __interrupt void Port2_ISR(void)

    mrfiPacket_t packet;
    MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED);

    P2IFG &= ~0x00; //
    I want when I power up the ED ,to toggle its green led and when smoke is detected to toggle its red led and transmit it to the AP making his red led to toggle as well.
    Thanks in advance for any information you could give me.
    Have a nice day.