• AVR Freaks

Hot!Problem with "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)"

Author
hansp
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2020/04/03 10:40:27
  • Location: Austria
  • Status: offline
2020/06/02 08:57:40 (permalink)
0

Problem with "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)"

Hello friends,
now i have the next task, I am using a dsPIC33CK256MP508 curiosity.
The analog module is very complicated. I have read this manual:
"12-Bit High-Speed, Multiple SARs A / D Converter (ADC)"
There are only examples with interrupt.
But I only want the same functionality as with simple PICs.
So just scan the values cyclically (without software). And then in the main loop e.g.
if (ADC1_IsConversionComplete ()) {
            ADC16Ptr = (uint16_t *) & (ADC1BUF0);
AI_Result[0] = *ADC16Ptr++;
AI_Result[1] = *ADC16Ptr++;
.....
}


I can only say, help.[/code]
#1

3 Replies Related Threads

    JPortici
    Super Member
    • Total Posts : 1153
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: Problem with "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)" 2020/06/02 10:32:21 (permalink)
    0
    two of the possible ways:
    -don't enable the interrupt, do things when the flag is set
    -don't enable the interrupt, use the channel conversion result ready flag
     
    #2
    hansp
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2020/04/03 10:40:27
    • Location: Austria
    • Status: offline
    Re: Problem with "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)" 2020/06/02 23:00:39 (permalink)
    0

    Thanks, result flag is what I want to use.
    But is there also a possibility that all the desired channels are automatically scanned and I only have to query the flag whether the conversion is finished? 
    The PIC24 MCC has the tick "scan enable" and how do I do that on this PIC33.
    In the manual I read from "Common software trigger" is that the desired function?
    #3
    JPortici
    Super Member
    • Total Posts : 1153
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: Problem with "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)" 2020/06/03 00:48:13 (permalink)
    0
    Question 1: If you Enable the various ADC channels interrupt, IIRC the ADC interrupt flag should be raised after all channel interrupts are converted, so at the end of the scan. But the reference manual should have a section specifically on interrupts to confirm or deny this.
     
    Question 2: It's The same in dsPIC33E, it's different in the dsPIC33C.
    You see that all channels have a trigger source. If more than one channel share the same trigger source (for example the common software trigger) the conversions will be queued and executed in sequence. This is how scan is implemented (and you can find a better explanation in the reference manual). This also permits you, i think, to scan a sequence with one trigger, scan another with another, but i have had no reason to try it myself so i don't know
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5