I hacked together some replacements for adcStart and adcStartConversion that use triple adc mode. This generally works, but there is something strange with the DMA stream, as the result from ADC3 is streamed twice every cycle.
The following shows the buffer directly printed to serial, and instead of ADC1[0], ADC2[0], ADC3[0], ADC1[1], ADC2[1], ... it shows ADC1[0], ADC2[0], ADC3[0], ADC3[1], ADC1[1], ADC2[1], ADC3[1], ...
Code: Select all
4095, 0, 1006, 1030, 4095, 0, 1030, 996, 4095, 2, 996, 1009,
4095, 10, 1005, 1020, 4095, 0, 1020, 1040, 4095, 0, 1040, 997,
4095, 0, 1005, 1024, 4095, 2, 1024, 976, 4095, 0, 976, 982,
4095, 1, 982, 997, 4095, 0, 997, 1010, 4095, 1, 979, 1025,
4095, 0, 985, 993, 4095, 6, 993, 995, 4095, 1, 995, 1007,
I use Triple ADC regular simultaneous mode, and DMA mode 1, which should give three half word dma requests, but instead seems to give four dma requests.
Anyone has an idea what could be happening?
The full code can be found at https://github.com/pierstitus/chibios-d ... i_adc_mode
I use three adc group configs and modified adcMultiStart() and adcMultiStartConversion() functions.
Thanks, Piers