Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
4 years, 3 months ago.
Problem with DAC (D12 / PA_6)
I have a problem with the third DAC (D12 / PA_6): if active simultaneously D13 and A_2 both work, but if the third active (D12 / PA6) only works this. The software is as follows
Question relating to:
3 years, 4 months ago.
I had the same problem and have now solved it after using a little bit of google translate magic on Jun's answer. The problem lies in mbed-dev (or mbed-src if you want to do it yourself) there was only one DAC handle setup but the STM32F334R8 has two DACs with three channels total. The exact file is here: targets/hal/TARGET_STM/TARGET_STM32F3/analogout_api.c
The fix was to make two handles and a make a pointer to the right handle for each function.
static DAC_HandleTypeDef DacHandle; //becomes: static DAC_HandleTypeDef DacHandle1; static DAC_HandleTypeDef DacHandle2; DAC_HandleTypeDef* DacHandle;
With a bit of jiggery pokery with & and * and -> symbols further down in the file it all works! See: https://developer.mbed.org/users/StevieWray/code/mbed-dev/ for more details. You can just import that version of mbed-dev and it should work for you.