You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ADC and DAC xxx_timed() methods can't be used concurrently #1129
Should I should go ahead and implement this? If yes: What is the proper way of doing that? I have another pull request (#1130) which is untouched since 22-FEB-2015 even though I thought I followed the instructions for pull requests. Implementing different timers for DAC and ADC is certainly more involved.
@ul5255 yes this is something you can try to implement. I didn't yet because it's difficult :) Especially since DMA restricts which timers work with which peripherals. And also I want to make ADC.read_timed work with DMA.
Please feel free to start thinking/hacking on these ideas. Eg a good start is to simply list all the timers and DMA channels for DAC and ADC and see which ones work with each other.
You can use any timer to set the read frequency. You can then use a different timer (or even the same one if you want the same frequency) for DAC.write_timed.
Activity
ul5255 commentedon Feb 22, 2015
I'd suggest to allocate one timer to the ADC(s) and a separate timer to the DAC(s).
dpgeorge commentedon Feb 22, 2015
Yes, that's a reasonable thing to do. Could even allow to pass a timer object in as a kwarg to select the timer, with default being tim6.
peterhinch commentedon Mar 6, 2015
That has the advantage of generality: for example you might want to allocate a timer to each DAC instance to enable them to output asynchronously.
ul5255 commentedon Apr 27, 2015
Should I should go ahead and implement this? If yes: What is the proper way of doing that? I have another pull request (#1130) which is untouched since 22-FEB-2015 even though I thought I followed the instructions for pull requests. Implementing different timers for DAC and ADC is certainly more involved.
dpgeorge commentedon Apr 27, 2015
@ul5255 yes this is something you can try to implement. I didn't yet because it's difficult :) Especially since DMA restricts which timers work with which peripherals. And also I want to make ADC.read_timed work with DMA.
Please feel free to start thinking/hacking on these ideas. Eg a good start is to simply list all the timers and DMA channels for DAC and ADC and see which ones work with each other.
stmhal: Allow DAC.write_timed to take Timer object in place of freq.
dpgeorge commentedon Jul 21, 2015
DAC now allows you to specify a different timer for write_timed, so both ADC and DAC can work together (ADC still uses Timer(6) always).
Would be nice to be able to specify timer for ADC similar to DAC, so leaving this issue open until that is implemented.
bmentink commentedon Jul 21, 2015
Can you also specify a different timer for each DAC channel? Is the current change checked in, I would like to try it.
dpgeorge commentedon Jul 21, 2015
stmhal: Allow ADC.read_timed to take Timer object in place of freq.
dpgeorge commentedon Jul 22, 2015
ADC.read_timed now allows to specify a timer to use for the triggering. For example:
You can use any timer to set the read frequency. You can then use a different timer (or even the same one if you want the same frequency) for DAC.write_timed.
bmentink commentedon Jul 22, 2015
Terrific! .... now all we need is DMA support for the Timer and it will be game-set-and-match ;)