Jump to content
Sign in to follow this  
nirbar11

Interrupts

Recommended Posts

Hello all,

Im using the MSP430 connecting to a device which outputs 4 bits sequence (parallel) every once in a while  and I want to get an interrupt for each new input sequence in port 1.

The input sequence voltage level is 3.6V and the MSP powered from the micro-USB (connected to the PC).

I also connected the GND of the device to the GND of the MSP.

this is my code :

 

void setup(){
Serial.begin(9600);

pinMode(P1_2,INPUT); 
pinMode(P1_3,INPUT); 
pinMode(P1_4,INPUT);
pinMode(P1_5,INPUT);

attachInterrupt(P1,intFunc,CHANGE); 

};

void intFunc(){

Serial.print("this is an interrupt - the value of P3.1 is :");
Serial.println(digitalRead(P1_3));

}


void loop()
{
delay(2000);
Serial.println("the is the main routine");
}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...