7 years, 4 months ago.

FRDM DAC

hello,

unfortunately am unable to make run the DAC0_OUT of my FRDM K64F card.

I tried this code :

  1. include "mbed.h"

The sinewave is created on this pin AnalogOut aout(DAC0_OUT);

int main() { const double pi = 3.141592653589793238462; const double amplitude = 0.5f; const double offset = 65535/2; double rads = 0.0; uint16_t sample = 0;

while(1) { sinewave output for (int i = 0; i < 360; i++) { rads = (pi * i) / 180.0f; sample = (uint16_t)(amplitude * (offset * (cos(rads + pi))) + offset); aout.write_u16(sample); wait_us(50); } } }

No voltage on the DAC0_OUT pin...? Some idea ?

Philippe

I have replicated this issue "DAC0_OUT of my FRDM K64F" no measured voltage.

The DAC0_OUT works OK using a FRDM K64F using "older" mbed code: https://developer.mbed.org/users/wd5gnr/code/HAD_SigGen/

So it seems like the "DAC0_OUT" isn't working in MBED OS 5.#.

Note that to replicate this you need to measure the output voltage on the DAC0_OUT pin. If you do a read of the output voltage in code, you get a value, but there is no measured voltage on the pin.

Again note that DAC0_OUT works Ok on older mbed code.

Martin

posted by martin bradley 06 Feb 2017

1 Answer

7 years, 2 months ago.

I have replicated this issue "DAC0_OUT of my FRDM K64F" no measured voltage.

The DAC0_OUT works OK using a FRDM K64F using "older" mbed code: https://developer.mbed.org/users/wd5gnr/code/HAD_SigGen/

So it seems like the "DAC0_OUT" isn't working in MBED OS 5.#.

Note that to replicate this you need to measure the output voltage on the DAC0_OUT pin. If you do a read of the output voltage in code, you get a value, but there is no measured voltage on the pin.

Again note that DAC0_OUT works Ok on older mbed code.

Martin