Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 63733

Forum Post: RE: msp432 adc14 stop single channel repeat mode

$
0
0
Luca, (1) The SHS bit field in ADC14 control register 0 (ADC14CTL0) controlls the trigger source for the ADC14. If this field is '0' then the ADC is triggered from the SC bit which is controlled in firmware. (2) You do not have to keep the ENC and SC in the same instruction. These can be in the same instruction but the ENC bit is not automatically cleared like the SC bit so it is not necessary to keep setting the ENC bit. Please see www.ti.com/.../slau356d.pdf . (3) The Timer ISR takes too long and you will not be able to get the number of samples that you want. For example if you want to sample at 5us rate for 1ms you should get 200 samples. With the 'if' statement that checks the variable microsecond the Timer ISR prevents service of the ADC14 interrupt and you end up missing samples. In the previous code I sent I put in error checks to help identify when this happens. My understanding of the original problem was that you were seeing 1.2ms instead of 1ms. This is because the time keeping mechanism microsecond+=STEP is dependent upon servicing the timer ISR at each step (5us) but in reality because the ISR takes so long the actual time for each interrupt service is longer. (4) Yes. Please see www.ti.com/.../slau356d.pdf . (5) Yes, if you want to service the ADC14 interrupt. I see several places in the code where you use '=' instead of '|=' when writing to NVIC_ISER0 please ensure that you are not overwriting your previous instructions. '|=' is a logical 'OR' while '&=' is a logical 'AND'. Typically |= is used to set bits while '&= ~' is used to clear bits, the '~' is the logical inverse so ~0x01 would be 0xFE. (6) Yes the idea is to stop the ADC after the correct number of conversions has been recorded. Regards, Chris

Viewing all articles
Browse latest Browse all 63733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>