This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello everyone,
I have a problem, using the comparator block with internal (DAC) reference, in a Piccolo C2000 MCU (TMS320F28027). While the comparator works perfectly with external reference, when I'm trying to code in order to give the comparator registers the suitable values for internal reference operation, the command I type is non accepted.
Specifically, I type : "Comp2Regs.DACCTL.bit.DACSOURCE= 0;" and this expression in not accepted in the code. The "ADC & Comparator Reference Guide" for C2000 Launchpad states that, for an internal reference in the comparator, the DACSOURCE bit of the DACCTL register should be set to 0 (DAC Controlled by DACVAL). You can see the problem I face in the attached pdf, which includes the C Code. Why is this command not accepted???
I wonder, if the specific register statements (DACCTL, DACSOURCE bit) are missing from the header file (#include "f2802x_common/include/comp.h"). How could I insert these statements by myself in the header file???
Thanks for your support!
Nick.comp_error.pdf
Nick,
You're right that the register definitions seem to be missing from the F2802x header files. You can copy over the full register definition for comp.h from F2803x. The comparator module is the same between the two devices.
Just take care to remove "Comp3Regs" and to replace "2803x" with "2802x" where needed.
I'll submit a ticket to have this fixed on F2802x. Sorry for the trouble.
-Tommy