Reputation: 1
I've been working on integrating the onboard ADC with an existing project I have on the MSP-EXP430FR2433. To do this, I'm using a WDT Interval Timer, querying the ADC for new data (with ADCCTL0 |= ADCENC | ADCSC;) every time the WDT ISR triggers. At low frequencies (WDT Interval Timer), this design works fine for the most part with the ADC ISR responding to the queries with data. However, when I increase the frequency of the WDT Interval Timer, the ADC ISR stops responding to my queries at all. My most recent thought is that there must be some kind of hold time violation in the query, but in context I'm not sure that makes any sense at all. I'm also considering the fact that I didn't configure the ADC correctly to work the way I want it to. Towards this, I've dropped my ADC configuration below. Any help on this issue is greatly appreciated.
SYSCFG2 |= ADCPCTL1;
ADCCTL0 |= ADCON;
ADCCTL1 |= ADCSHP | ADCSSEL1 | ADCSSEL0;
ADCCTL2 |= ADCRES;
ADCMCTL0 |= ADCINCH_1;
ADCIE |= ADCIE0;
Upvotes: 0
Views: 96
Reputation: 252
Try temporarily replacing the WDT interval timer with just simple software delay routine. Be sure to completely disable the WDT at the start of the program. Suggest using the compiler intrinsic function __delay_cycles(1000) for the delay. This will eliminate the possibility of interrupt priorities or bad WDT configurations. If this works, then start reducing the delay amount until you arrive at your required rate. If you reach the required rate (fastest ADC sampling you wanted) then the ADC is not the problem. You may then want to replace the WDT interval timer with a real hardware timer, or just live with the __delay_cycles() software delay.
Upvotes: 0