Hello, i got a problem, I am trying to save some ADC data in a vector, after that I want to displace the data one position and save it in another vector, but the problem is that when I do that, the "CORTEX_M4_0 - Debug Call Stack" stops my program every time I run it, this "Debug Call stack" is located in the line 84, where I load a new ADC value in the vector position 0 "ADC_14_BUF2[1]=ADC14->MEM[0];". What is that CORTEX_M4_0 - Debug Call Stack???, and why it stop my program??. #include "msp.h" #include volatile short ADC1; volatile long i = 0; volatile int j = 0; short ADC_14_BUF[6]; short ADC_14_BUF2[6]; int ADC_14_BUF_SIZE = sizeof(ADC_14_BUF)/2 ; int main(void) { WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer /*---------------------------------------------------------------------------------------------------------*/ //Configuracion de la señal de CLK CS->KEY = 0x695A; // Unlock CS module for register access CS->CTL0 = 0; // Reset tuning parameters CS->CTL0 = CS_CTL0_DCORSEL_5; // Set DCO to 48MHz (nominal, center of 8-16MHz range) // Select ACLK = REFO, SMCLK = MCLK = DCO CS->CTL1 = CS_CTL1_SELA_2 | CS_CTL1_SELS_3 | CS_CTL1_SELM_3; CS->KEY = 0; // Lock CS module from unintended accesses /*---------------------------------------------------------------------------------------------------------*/ // Configure GPIO P5SEL1 |= BIT5 | BIT4 | BIT3 |BIT2; // Enable A/D channel A0-A3 P5SEL0 |= BIT5 | BIT4 | BIT3 |BIT2; __enable_interrupt(); NVIC->ISER[0] = 1 CTL0 = ADC14_CTL0_ON | ADC14_CTL0_MSC | ADC14_CTL0_SHT0__192 | ADC14_CTL0_SHP | ADC14_CTL0_CONSEQ_3; // Turn on ADC14, extend sampling time // to avoid overflow of results ADC14->MCTL[0] = ADC14_MCTLN_INCH_0; // ref+=AVcc, channel = A0 ADC14->IER0 = ADC14_IER0_IE0; // Enable ADC14IFG.3 SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; // Wake up on exit from ISR /*---------------------------------------------------------------------------------------------------------*/ // Configuracion de los puertos UART P1SEL0 |= BIT2 | BIT3; // set 2-UART pin as second function __enable_interrupt(); NVIC->ISER[0] = 1 CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; // Start conversion-software trigger // while(!(UCA0IFG&UCTXIFG)); UCA0TXBUF = 'A'; // while(!(UCA0IFG&UCTXIFG)); UCA0TXBUF = 'B'; // while(!(UCA0IFG&UCTXIFG)); UCA0TXBUF = 'C'; } } // ADC14 interrupt service routine void ADC14_IRQHandler(void) { if (ADC14->IFGR0 & ADC14_IFGR0_IFG3) while(!(UCA0IFG&UCTXIFG)); { ADC_14_BUF[i] = ADC14->MEM[0]; i=i+1; // if (i > 5) i=0; if(i == ADC_14_BUF_SIZE) { ADC_14_BUF2[5]=ADC_14_BUF[4]; ADC_14_BUF2[4]=ADC_14_BUF[3]; ADC_14_BUF2[3]=ADC_14_BUF[2]; ADC_14_BUF2[2]=ADC_14_BUF[1]; ADC_14_BUF2[1]=ADC14->MEM[0]; i=0; } // } } /*---------------------------------------------------------------------------------------------------------*/ // Rutina de interrupcion de UART void EUSCIA0_IRQHandler(void) { if (UCA0IFG & UCRXIFG) { // while(!(UCA0IFG&UCTXIFG)); } } /*---------------------------------------------------------------------------------------------------------*/
↧