Jump to content
biza

some doubds in code, changing from MSP430FR5989 to MSP432P401R

Recommended Posts

hello friends,
I am developing a project to school, and I need control a sensor with use a timer, but studying some code, i find a piece of code really similar what i need to do. the problem is inside of interrupt it's is switch code where he call a function "__even_in_range()", this sintaxe only is knowned on the MSP430 plantaform. In MSP432, no is present. So there anyone can help me change the follwing code used in MSP430 to MSP432?
Thanks in advance.

#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer0_A0_ISR (void)
{

	  switch(__even_in_range(TA0IV, TA0IV_TAIFG))
	  {
	    case TA0IV_NONE:
	    	__no_operation();
	    	break;               // No interrupt
	    case TA0IV_TACCR1:
	    	__no_operation();
	    	break;
	    case TA0IV_TACCR2:
	    	__no_operation();
	    	break;
	    case TA0IV_3:
	    	__no_operation();
	    	break;               // reserved
	    case TA0IV_4:
	    	__no_operation();
	    	break;               // reserved
	    case TA0IV_5:
	    	__no_operation();
	    	break;               // reserved
	    case TA0IV_6:
	    	__no_operation();
	    	break;               // reserved
	    case TA0IV_TAIFG:                       // overflow
	    	 TA0CTL &= ~TAIFG;
	    	__no_operation();
	    	break;
	    default:
	    	__no_operation();
	    	break;
	  }
}

my doubd is I can change the  follwing code:

#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer0_A0_ISR (void)
{

for (MSP432):

void TA0_0_IRQHandler(void) {

void TA0_0_IRQHandler(void) {

but the major problem is:

switch(__even_in_range(TA0IV, TA0IV_TAIFG)){
	case TA0IV_NONE:
		__no_operation();
	break;               // No interrupt

 

Share this post


Link to post
Share on other sites

It appears you're working with CCS and based on the device you reference, I'd suggest looking at the "Register Level" code examples in the Simplelink MSP432P4 SDK. (Resource Explorer)

The one I found that is likely a good starting place for a simple timer A0 interrupt handler is found in the msp432p401xta0_01 code example for CCS.Snap35.thumb.png.ff67c6671554c98845b7005f09fb44ca.png

 

 

 

Share this post


Link to post
Share on other sites

__even_in_range is an instrinsic function added for the MSP430 which allows the compiler to generate optimized code using the TAIV register.

As it is just used to generate optimized code you can also just leave it away.

So use that line:

switch(TA0IV)

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.


×
×
  • Create New...