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.
9 years ago.
DAC does not work well
I tried sine wave sample program in 32L152RE and not work well. onboard SBnn connection is same as initial state. I get 150Hz sine wave in PA4, but its amplitude is 0-200mV. I think that is because outbuffer-amp is off or because power is not supplied to DAC. Please tell me the reason and way to make it go well.
1 Answer
9 years ago.
instead of
//#define RANGE (4096/2) // 12 bits DAC //#define OFFSET (4096/2) // 12 bits DAC
try these lines
#define RANGE (65535/2) #define OFFSET (65535/2)
The same old story arises: the hardware DAC has indeed 12 bits, but the library defines the full range as 16 bits. That's why your output was soooo small.
Regards,