#include <msp430g2553.h> void configWDT(void); void configClocks(void); void configADC(void); void configTimerA(void); void faultRoutine(void); void startADC(void); int ekgON = 0; int systemIsSetUp = 0; volatile int tempRaw = 0; int test_ISR_counter = 0; int dummy1 = 0; int main(void) { configWDT(); configClocks(); _BIS_SR(GIE); systemIsSetUp = 1; P1DIR = 0x41; // P1.0 & 6 output (red/green LEDs) - just for indication right now, not important for any function P1OUT = 0; ekgON = 1; //manually set: ekgON //while(ekgON == 0){} configTimerA(); configADC(); startADC(); while(ekgON == 1){ dummy1++; } / return 0; } void configWDT(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer } void configClocks(void){ if (CALBC1_1MHZ ==0xFF || CALDCO_1MHZ == 0xFF){ faultRoutine(); // If calibration data is erased // run FaultRoutine() }else{} //what should be in FalseRoutine???? BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation BCSCTL3 |= LFXT1S_2; // LFXT1 = VLO IFG1 &= ~OFIFG; // Clear OSCFault flag BCSCTL2 = SELM_0 + DIVS0 + DIVS1; // MCLK = DCO = 1MHz - SMLCK = MCLK/8 } void configADC(void){ ADC10CTL0 = 0; ADC10CTL0 = SREF_1 + ADC10SR + REFON + ADC10ON + ADC10IE; //Sample and Hold Time: 8*CLK (!!) - reduce sampling rate to 50ksps - internal Reference at 1,5V - ADC10 on - ADC10 interrupt enabled ADC10CTL1 = INCH_10 + SHS1 + CONSEQ1; //Input Channel TempSensor - Source is Internal CLock - Trigger sourced from TimerA Output Unit 0 - Repeated single channel conversion } void configTimerA(void){ TACTL = TASSEL1 + MC0; // SMCLK - Up Mode TACCTL0 = OUTMOD_4; //Output Mode 4 (toggle) TACCR0 = 0x271; //625 } void faultRoutine(void) { P1OUT = 0x01; // red LED on while(1); // TRAP } #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR (void){ tempRaw = ADC10MEM; test_ISR_counter++; } void startADC(){ ADC10CTL0 |= ENC + ADC10SC; // first conversion is started, afterwards the timerA triggers the ADC }
Tool/software: Code Composer Studio
Hello, I am currently working with an MSP430G2553, which performs conversions with the ADC10 triggered by TimerA.
I created two expression to check the functionality of my programm:
- tempRaw: here I store the value from the Temperatur Sensor and wan to check the value with the expression
- test_ISR_counter: I want to check how often the the ISR routine of the ADC10 has been started
When I start the programm in debug mode the expression can not be read: tempRaw unknown Could not read 0x0204: execution state prevented access (picture)
When I click the suspend button in debug Mode I can see values for both expressions (seems to fit to my programm) (picture)
Since I want to have my expressions updated automatically, I added an Breakpoint (--> refresh all windows) in the while loop. However, when I start the programm both expressions are not cahnged at all. (picture)
Now I have two questions:
1. Why do I get the error message "execution state prevented access"? Do I have to change something in my programm?
2. Why are my expressions not changed at all when I add an Breakpoint which is supposed to just update the expressions?
Thanks!
Markus