Neetee

Msp430f5529 interrupt with adc

12 posts in this topic

Hello all

 

I read all the posts on this forum as said in suggestions

So with this i came across an idea.

Can some one tell that if i make my data aquisition system interrupt enabled

This means taking value from adc will be normal calculation for flowrate will be also normal

But when ever i need to show totaliser count that will be interrupt enabled can some one help.

Really need help .

Share this post


Link to post
Share on other sites

I am not quite sure what you are asking. Can you explain what you want interrupt enabled and what should happen in the interrupt service routine?

Share this post


Link to post
Share on other sites

Ok let me tell you

I am trying to design a menu system which is user interface for my device

I have already designed it

But the data aquisition should be independent of any key press

Thus either i need to make my keys interrupt enabled or adc but as i read yesterday i cannot make adc interrupt enabled as it

I also tried to make keys interrupt enabled and it worked yesterday partially

Now i will try to make it work full and will post the results

Share this post


Link to post
Share on other sites

If i press key it should directly switch to menu option it is working but partially working

Share this post


Link to post
Share on other sites

Is there a specific event when you must read the ADC?

 

If not, just make one main loop that reads keys and ADC. Reading the ADC should only take a fraction of a second.

Share this post


Link to post
Share on other sites

@@Neetee

 

Some suggestions for you so that you can better be helped by the users on the forum:

 

Provide the Launchpad you are using, as well as any Boosterpacks.

Provide your code - it is difficult to understand what is happening without this.

Explain what is working and what isn't working. And if something isn't working, what exactly is happening and what you have already tried in an attempt to get it working.

If you are using any of your own circuits besides the basic Launchpad, please detail that with a schematic.

If possible provide a photo of your setup.  Sometimes issues have been spotted with this additional information.

 

The upside for you is that you will get more useful information in a shorter time frame.

 

EDIT:  Apparently @@chicken posted while I was composing this post.

Share this post


Link to post
Share on other sites

Ok

Launch pad i am using is msp430f5529

I am designing menu system menu system is working perfectly fine without interrupt

I am operating this with mobile thats why cannot post my code right now but will surely do it in next few hrs

 

I am trying to design a flow integartor totaliser

Adc value should be detected irrespective of any key press

There are 3 for loops in side my data processing routine they are affecting key detection out side data processing routine

 

So i am trying to desing intrupt based key detection

So that key will be detected with interupt

My key is attached to P2_0

 

As this is the key which allows me to enter my programming menu to set some parameters

Share this post


Link to post
Share on other sites

I am trying to execute interrupt with key press so what should it do

Should i check the keypress inside

Share this post


Link to post
Share on other sites

Did you already try using attachInterrupt() http://energia.nu/AttachInterrupt.html.

volatile int state = HIGH;
volatile int flag = HIGH;
int count = 0;

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

  pinMode(GREEN_LED, OUTPUT);
  digitalWrite(GREEN_LED, state);

  /* Enable internal pullup. 
   * Without the pin will float and the example will not work */
  pinMode(PUSH2, INPUT_PULLUP);
  attachInterrupt(PUSH2, blink, FALLING); // Interrupt is fired whenever button is pressed
}

void loop()
{
  digitalWrite(GREEN_LED, state); //LED starts ON
  if(flag) {
    count++;
    Serial.println(count);
    flag = LOW;
  }
}

void blink()
{
  state = !state;
  flag = HIGH;
}

Share this post


Link to post
Share on other sites

I am using msp430f5529 launch pad every one suggested me this example

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