DAC1 noise generation

11 Jun 2015

Hey guys!

So I'm quite new to mbed development and after reading STM32's documentation I've been wanting to use the DAC's noise generator. From what I've seen, mbed's HAL doesn't allows that so I tried to directly write on the registers to enable DAC1's noise output.

Here is what I've written :

    DAC1->CR &= 0xFFFF0000;
    DAC1->CR |= 0x00000B00; // Amplitude set to 2047 ( MAMP1 = 1011 )
    DAC1->CR |= 0x00000040; // Select noise output ( WAVE1 = 01 )
    DAC1->CR |= ( 0 << 2 ); // Trigger disabled
    DAC1->CR |= ( 1 << 0 ); // DAC1 Channel 1 enabled

But it doesn't work... Could you get me on track as how to achieve what I'm trying to achieve? Thank you very much in advance!