Sign in to follow this  
Followers 0
nirbar11

Interrupts

1 post in this topic

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0