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.
11 years, 8 months ago.
AnalogOut doesn't output zero volts
The analog output is working, but it doesn't go below approximately 130 mV. I tried setting it to zero (see code snippet), but it's no where close (see scope image). As you can see, the output is very noisy. Also, I have noticed some ghosting on the LEDs. The documentation says that the analog output should go from 0.0 to 3.3 volts. Has anyone else had this problem?
#include "mbed.h" AnalogOut tri(p18); int main() { tri = 0; }
2 Answers
11 years, 8 months ago.
The mbed (lpc1768) has only one GND pin and that is one of the reasons why analog inputs and outputs are rather noisy. You may want to make sure that your scope is connected directly to the GND pin of mbed (pin 2). Also check powersupply noise suppression since that feeds directly into the ADC and DAC. In case you still end up with too much noise you may want to consider a separate DAC device (I2C or SPI) or look into other LPC1768 based motherboards that provide better analog PCB layout and circuitry.
Wim, thanks for your response. I am getting the same result even with the scope connected directly to the ground pin. I also tried connecting a 0.1 uF capacitor on Vout with no significant improvement. I am also seeing a DC voltage on the analog output with a DMM. Looking at the schematic, I see an LC filter between the digital supply and the analog supply, so this sort of noise suppression should be built in. I think this thing is defective because it doesn't go to zero volts as stated in the analog out reference. As you mentioned it might also be due to poor layout/design. In either case it doesn't perform as advertised and I think I am going to try to return it. The built-in DAC was a major selling point for me and my application requires a DAC that can operate down to zero volts.
Thanks again for your response!
posted by 20 Dec 201311 years, 8 months ago.
There is always going to be some noise, that is inevitable, because the micro is running (two micros) at 72 Mhz, as well as the Ethernet chip, with a separate 50Mhz clock chip!!!!
try putting some load on the DAC O/P pin, 1K, in parallel with 1 to 10 nF should give a big improvement , also, depending on the frequency range you need, an RCL filter might be worth considering.
hope that's usefully
Ceri