ADuC7024 ADC - Misc questions

Hi,


I have a few questions regarding the behaviour of the ADC peripheral on the ADuC7024 that I hope can be commented on:


i) After an ADC conversion has completed (ADCReady = 1) are the contents of bits 0 to 15 in ADCDAT all 0 or other/undefined?


ii) Data sheet Rev C, P44 says that reading ADCDAT clears ADCReady (ADCSTA, Bit 0). Does this also clear the ADC Channel (bit 7) in IRQSIG?


iii) With ADCCON configured for conversion on Timer 1 (bits 2:0 = 001) is it acceptable to read ADCDAT after a previous conversion has been performed (ADCReady = 0) and while a new conversion is in progress (ADCBUSY = 1)? I want to avoid the possibility of reading a value that is neither the result of the previous, or current conversion, such as when the result is being transferred internally to ADCDAT?


iv) What happens if ADCCON is written to/changed, while an ADC conversion is in progress (ADCBusy = 1) - does it affect the conversion in progress?


v) What happens if ADC channel is changed (ADCCP) while an ADC conversion is in progress (ADCBusy = 1) - does it affect the conversion in progress?


Thanks.

Parents
  • Thanks for the answers. I've follow up questions on two of the points:

    i) The reason behind this question is that I was thinking of the situation of reading out ADCDAT value and using it directly in say a digital filter as below, FilterValue is 32 bit unsigned, and whether the masking out of the lower 16bits of ADCDAT was required. I'd rather not include the mask operation unless absolutley essential. If the lower 16 bits of ADCDAT were all 0 (not stated in the data sheet) then I would leave it out.

         FilterValue[i] = FilterValue[i-1] + ((ADCDAT & 0x3FFF0000) >>5) +....

         ProcessFilter(FilterValue>>16);

    ii) I Always thought IRQSTA = IRQSIG & IRQEN, and didn't realise bits in IRQSIG and IRQSTA were latched differently. So are you saying that when leaving an interrupt handler (IRQ_Handler) then all IRQ bits that are 0 will have the corresponding bits in IRQSTA cleared automatically by the processor? Does this clearing of IRQSTA bits on exiting the ISR depend on the corresponding bit(s) in IRQEN being set?

Reply
  • Thanks for the answers. I've follow up questions on two of the points:

    i) The reason behind this question is that I was thinking of the situation of reading out ADCDAT value and using it directly in say a digital filter as below, FilterValue is 32 bit unsigned, and whether the masking out of the lower 16bits of ADCDAT was required. I'd rather not include the mask operation unless absolutley essential. If the lower 16 bits of ADCDAT were all 0 (not stated in the data sheet) then I would leave it out.

         FilterValue[i] = FilterValue[i-1] + ((ADCDAT & 0x3FFF0000) >>5) +....

         ProcessFilter(FilterValue>>16);

    ii) I Always thought IRQSTA = IRQSIG & IRQEN, and didn't realise bits in IRQSIG and IRQSTA were latched differently. So are you saying that when leaving an interrupt handler (IRQ_Handler) then all IRQ bits that are 0 will have the corresponding bits in IRQSTA cleared automatically by the processor? Does this clearing of IRQSTA bits on exiting the ISR depend on the corresponding bit(s) in IRQEN being set?

Children
No Data