7 years, 6 months ago.

PinNames for AnalogOut on NUCLO-072rb

I've been trying to use the example code (sawtooth function) for the AnalogOut function in mbed.h, but as written and every variation I've been able to find or think of is rejected by the compiler as 'undefined'

Make a sawtooth output

AnalogOut tri(p18);

I've not been able to find where this is specified. I've tried the literal values from a couple of header files without luck.

According to the STM32f072 documentation, Port A4 and A5 serve as the DAC outputs of the chip as alternate functions. I wonder if there is some setup that needs to be done before using AnalogOut.

Thanks!

1 Answer

7 years, 6 months ago.

According to the board pin layout the AnalogOut can be found on PA_4 and PA_5. You should select either one of these pinnames in the code. Note that the pinname p18 shown in your code above is only used for the LPC1768 and LPC11u24.