Hi, I'm playing with DACs and using dac_output_voltage(DAC_CHANNEL_1, a); dac_output_voltage(DAC_CHANNEL_2, b); i'm able to write 2 separate values on the ADCs.
The issue is that using this 2 separate instructions, the 2 outputs are not updated simultaneously.
Is it possible accessing directly the DACs registers to load the 2 values and update the 2 outs simultaneously?
This is the source of information I'm using:
http://esp-idf.readthedocs.io/en/latest ... s/dac.html
Thanks
Mauro
ESP32 DAC1 and DAC2 not synchronous on Arduino IDE
Re: ESP32 DAC1 and DAC2 not synchronous on Arduino IDE
Why not use ledcWrite?
Re: ESP32 DAC1 and DAC2 not synchronous on Arduino IDE
Hi, thank you for your suggestion...
I was reading all the documentation regarding ledc.h but if I got it correctly I think I'll have the same issue, because all the ledc channels are separated and I'll have to call 2 separate ledc_set_duty and ledc_update_duty for each channel.
This will end up again on a time difference between the voltages output change.
For my porpose the DACs are perfect, because the output voltage change is super fast and precise.
I hope I can find a way to load the value to be set on the 2 DACs and update the output voltages simultaneously like a common I2C or SPI commercial dual DAC IC.
Mauro
I was reading all the documentation regarding ledc.h but if I got it correctly I think I'll have the same issue, because all the ledc channels are separated and I'll have to call 2 separate ledc_set_duty and ledc_update_duty for each channel.
This will end up again on a time difference between the voltages output change.
For my porpose the DACs are perfect, because the output voltage change is super fast and precise.
I hope I can find a way to load the value to be set on the 2 DACs and update the output voltages simultaneously like a common I2C or SPI commercial dual DAC IC.
Mauro
Re: ESP32 DAC1 and DAC2 not synchronous on Arduino IDE
You could put a sample-and-hold circuit on the output of each DAC. The output voltages of the sample-and-hold circuits could be held while the the software changes one DAC voltage then the other. A GPIO digital output would control both sample-and-hold circuits so their outputs would change simultaneously when the control changes from 'hold' to 'sample'.
Re: ESP32 DAC1 and DAC2 not synchronous on Arduino IDE
How about dual core??
The sampling and hold circuit will work for sure but it require external hardware and keeping the external circuit simple it will slow down the performance.
I've already purchase a MCP4802 that should do the trick for my test jig, but I was really hoping to find a software/register/trick as workaround.
While I'm waiting for the MCP4802 I was playng with the dual core!!!
The idea is to synchronize the call of dac_output_voltage(DAC_CHANNEL_x, a-b), one for each core.
If one of the 2 will finish, it will wait for the other to complete the operation and will start again simultaneusly.
What do you think?
I'll write the code and will let you know how it goes.
If you already know this can't work please stop me
Mauro
The sampling and hold circuit will work for sure but it require external hardware and keeping the external circuit simple it will slow down the performance.
I've already purchase a MCP4802 that should do the trick for my test jig, but I was really hoping to find a software/register/trick as workaround.
While I'm waiting for the MCP4802 I was playng with the dual core!!!
The idea is to synchronize the call of dac_output_voltage(DAC_CHANNEL_x, a-b), one for each core.
If one of the 2 will finish, it will wait for the other to complete the operation and will start again simultaneusly.
What do you think?
I'll write the code and will let you know how it goes.
If you already know this can't work please stop me
Mauro
Re: ESP32 DAC1 and DAC2 not synchronous on Arduino IDE
Remember: the second core is not idling uselessly, it provides WiFi+Bluettoth and needs some prime time to do that.mauroh wrote:How about dual core??
While I'm waiting for the MCP4802 I was playng with the dual core!!!
The idea is to synchronize the call of dac_output_voltage(DAC_CHANNEL_x, a-b), one for each core.
Mauro
Who is online
Users browsing this forum: No registered users and 116 guests