I'm just getting familiar with the FRDM-K64F board and have gotten a bunch of things working, ADC, GPIO, etc. What's not going so well is getting the DAC to work. Specifically nothing comes out on the DAC0_OUT pin when trying to configure it with Processor Expert (as Eclipse plugin).
When I try the online compiler at mbed.org, there is no problem, I get what I expect so I'm probing the right pin.
With my Processor Expert code, I don't see any obvious errors, but nothing comes out, even following exactly the "typical usage" code in the help.
I've checked the return from DAC_Enable() and it is okay. I've checked DAC_SetValue(), DAC_SetValue8(), DAC_SetValue16() and these also return ERR_OK. In fact, I specifically set DAC_Disable() as well to test to make sure I read back an error in this case, and it does.
I saw a similar thread No output DAC0 or 1 using CW10.5 using PE DAC_LDD component on K70 tower board so I tried those suggested tricks, but still nothing. I added & configured VREF component, no luck.
Any other things I need to try?
=======================================================
// This is the typical usage example in the Help. It doesn't work
byte i = 128;
DA1_Enable();
for(;;) {
if (i == 255) {
i = 0;
}
else {
i++;
}
DA1_SetValue8(&i);
}
=======================================================
Another odd thing I noticed is that if I try a low level write to the register, e.g.
=======================================================
volatile char *DAC_BASE_ADDR;
DAC_BASE_ADDR = (char *) 0x400CC000;
*(DACBASEADDR + 0x21) = 0xC0;
=======================================================
it doesn't seem to do anything. If I use DAC_Enable() first, this doesn't disable it if I write 0x00 and if I use DAC_Disable(), this fails to enable it. I use the same technique to do low level GPIO toggle and it works as expected.