Tool/software:
Hi, I am currently looking at implementing the ADC design for our project.
In summary ADC1-4 will be used. Each ADC may have 4-6 channels to convert. We want to do oversampling: converting all channels 4 times, then take results and post process the data to calculate the averages of all conversions.
Other information:
- PWMs running @ 40Khz, ADC conversion and control code running at 20khz
- PWM0 will generate ADCSOCA that triggers all ADC conversions
- At the end of oversampling all ADCs, the results are processed to calculate averages and then the control code is run. Currently ADC1 EOC5 triggers an interrupt XBAR
There seems to be a couple of solutions, but neither is ideal. Can TI help provide a best approach here or suggest a different implementations.
### Implementation #1 (PPB & Repeaters):
- Set up all SOCs to trigger using repeater set to x4
- Set up PPB to sum and find min/max
- Set up PPC OSINT to generate ISR and run Control code
Challenges with this method:
- There are only 4 PPB per ADC. Some ADCs have > 4 SOCs. Is this method even possible given we need > 4 PPB per ADC?
- Still need to keep track of remaining ADC results so that averaging math can be done in SW.
### Implementation #2 (continuous DMA):
- Create an ADC results memory buffer.
- Set up last EOC to generate ADCINT1
- Set up all SOCs for continuous conversion
- Set up DMA to copy all ADCRESULT regs from SOC0-SOCx to memory buffer on last EOC.
- Set up DMA generate interrupt when buffer is filled. (ie. 4xSOC RESULTS) which then runs processes buffer for average and runs control code
Challenges with this method:
- Much more involved.
- How does ADC stop converting after buffer is full?
- Can DMA copy all SOC Results to an offset that automatically increments? (Not much DMA experience here)
- Is the DMA latency comparable to a simple ISR that copies the result registers?
- Due to errata i2355, how many DMAs do we need? 4 ADC x 2 = 8?
Any other suggestions? I'm hoping to get some suggestions from experienced AM263 developers here.
Thanks for the support.