7 years, 1 month ago.

This board doesn't support AnalogOut, why ?

Hi, I need the DAC (AnalogOut) function for reference voltage, why does this board not implement ? Thanks.

Update 171017

So far, I implemented my own version as following code, but I think is not a good way.

DAC output

void dac_output(uint32_t mv) {
    PlatformMutex mutex;
    mutex.lock();

    /* Enable DAC clock */
    CLK_EnableModuleClock(DAC_MODULE);

    /* Config PB0 as DAC output */
    SYS->GPB_MFPL &= ~SYS_GPB_MFPL_PB0MFP_Msk;
    SYS->GPB_MFPL |= SYS_GPB_MFPL_PB0MFP_DAC ;

    /* Internal Vref 3.072V */
    SYS_UnlockReg();
    SYS->VREFCTL = (SYS->VREFCTL & ~SYS_VREFCTL_VREFCTL_Msk) | SYS_VREFCTL_VREF_3_072V;
    SYS_LockReg();

    /* DAC output */
    DAC_T *dac_base = (DAC_T *) DAC_BASE;
    DAC_Open(dac_base, 0, DAC_WRITE_DAT_TRIGGER);
    DAC_SetDelayTime(dac_base, 8);
    DAC_WRITE_DATA(dac_base, 0, ((4096UL * mv) / 3072));

    mutex.unlock();
}

Question relating to:

The NuMaker Platform is an Internet of Things (IoT) application focused platform specially developed by Nuvoton. It supports ARM mbed OS 5.0 as well as Arduino interface, and is ideal …

2 Answers

6 years ago.

Hi, About AnalogOut, we will implement it by DAC. Hopefully, to be merged into Mbed OS by 2018/12.

BR. Chris

NuMaker series AnalogOut patch already merged in mbed-os gitHub and will be active in mbed-os-5.11.1

posted by cy liang 12 Dec 2018
6 years ago.

Easily the mapping you expect (digital pins) this must be called prior to any I2C reads or writes before the program can operate be transformed into e difference is that analog write with pin D5. Or use to many different platforms.

Best Dissertation Help UK