Home > Back-end >  SCM model MSP430AFE221: enter the interrupt function SD24IV value is always 0 or 2, anxious to help,
SCM model MSP430AFE221: enter the interrupt function SD24IV value is always 0 or 2, anxious to help,

Time:10-26

//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//function name: void SD24_Init (void)
//function description: the SD24 initialization function
//say:
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Void SD24_Init (void)
{
Int n, I;
SD24CTL=SD24REFON + SD24SSEL0 + SD24DIV_3 + SD24XDIV_3 + SD24OVIE + SD24VMIDON;//1.2 V ref, SMCLK, eight points frequency
SD24CCTL0 |=SD24LSBACC + SD24LSBTOG;//Single conv, enable interrupt, automatic height change, low initial read
SD24INCTL0 |=SD24INCH_0 + SD24INTDLY0;//

For (n=0; N<8; N++)
{
For (I=0; i <0 x3600; I++);//Delay for 1.2 V ref startup
}

}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//function name: void SD24AISR (void)
//function description: the SD24 interrupt function
//say:
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# pragma vector=SD24_VECTOR
__interrupt void SD24AISR (void)
{
SD24CCTL0 & amp;=~ SD24IE;
SD24CCTL0 & amp;=~ SD24SC;
The switch (SD24IV)
{
Case 2://SD24MEM Overflow

break;
Case 4:
Results [index]=SD24MEM0;
break;
}
//delay_us (200);
SD24CCTL0 |=SD24IE;
SD24CCTL0 |=SD24SC;
}
SCM model MSP430AFE221, enter the interrupt function SD24IV value is always 0 or two, and I don't know why?
To help solve the prawns, first thanks ~
  • Related