-3

Im trying to generate analog signal with Nucleo RF411, started with https://developer.mbed.org/handbook/AnalogIn demo (I wanna use ADC to check if/how DCA is working), AnalogIn seems to be working just fine - Im getting some data. But I can't seem to set data - AnalogOut is unknown. According to screenshot both AnalogIn.h and AnalogOut.h are linked (or so I think), but only AnalogIn works.

What am I missing?

EDIT - I've tried downloading and compiling AnalogOut example, it doesnt seem to work either - https://developer.mbed.org/handbook/AnalogOut Ive exported it into Keil, and something is wrong with AnalogOut method still. As if some library was missing or whatnot.

Benji
  • 23
  • 1
  • 5

1 Answers1

0

I think your board is Nucleo F411RE, which, unfortunately, does not have a DAC; the AnalogOut specifically mention that a DAC output pin is not available everywhere. The Nucleo F410 board has such DAC. To see the data from ADC, you may use the STLink connection, present on your board and just printf to a terminal, or set a breakpoint in your code and examine the conversion result. One mention: if you do not have a DAC, you may attach such device externally. Another alternative solution is to use a PWM output pin, with the expense of two components, a Resistor and Capacitor, to form a filter. PWM can be either a such module in your micro or a timer with PWM capability.

Yoan
  • 161
  • 3
  • 8
  • Thanks, why didnt I think of that? Sometimes the simplest solutions are the ones you dont think of. I mean it was logical for me to assume that if you have ADC, you would have DAC too. Thanks for the tip about PWM, but that wont be necessary - I simply wanted to check if my ADC is working or not, but grounding it shows different values than when its not connected to anything, so Ill asume its working for now. I have a microphone board for futher testing. – Benji Dec 11 '16 at 21:59
  • Better than a microphone is a potentiometer wired between ground and reference voltage and the wiper wired to ADC input, to see the behaviour. Then move to sampling some repetitive signal. – Yoan Dec 12 '16 at 15:40