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.

MSP430-RF2500 and PIC 16F628A interconnection

Hi, My name is Kostas and I'm facing a problem. I'm experimenting with the interconnection of MSP430-RF2500 with PIC16F628A. The circuit of my project is shown in the image below:

The input in the extension pin P6 (p2.3) of the MSP430, through the voltage divider, is between 2.6V - 3V. The program on the PIC toggles pin 6 in predefined intervals. In order to detect these changes with the MSP I'm using a simple interrupt at the p2.3 where, when the output of the PIC is in high state, the on-board led of the MSP changes its state (toggles). The problem is that after the first detection (led turns on) the program freezes. The code for the MSP is shown below:

#include "io430.h"
int main( void )
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x03;
P2REN |= 0x08;
P2IE |= 0x08;
__bis_SR_register(GIE);
while(1);
}
#pragma vector=PORT2_VECTOR
__interrupt void Port_2 (void)
{
P2IFG &= ~0x08;
P1OUT ^= 0x03;

}

What am I doing wrong?

  • Hi Kostas,

    try this:

    while(1){

    __bis_SR_register(GIE);

    }

    regards

    Gastón

  • Thank you Mr Gaston that was really helpful!

  • Gaston_Melo_Arg said:
    try this:while(1){
    __bis_SR_register(GIE);
    }

    This shouldn't make a difference. GIE is set and remains set. It is temporarily cleared during ISR execution but restored to it original state on ISR exit.
    Inside the ISR, nothing is done that would cause GIE to be clear on exit.

    I suspect the problem somewhere else.

    The input signal should be 0V or 2.5V, depending on PIC pin state. However, on the MSP input, the internal pullps are active. Or rather pulldowns. So it doesn't reach 2.5V but (depending on pullup strength) ~2.1V
    So it is possible that the input signal won't reach sufficient high level again after it was pulled low once. Therefore no more interrupts happen.

    Adding
    P2OUT|=0x08;
    will turn the pulldown into a pullup. Then the signal should go up to 3V and down to 0.4V (worst case)

**Attention** This is a public forum