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.

F28027的COMP寄存器如何写入呢

Other Parts Discussed in Thread: CONTROLSUITE

C2000系列的F28027

我想使用里面的比较器模块 发现没法写入COMP寄存器

我用了两种程序

1

EALLOW;
AdcRegs.ADCCTL1.bit.ADCBGPWD=1;
Comp1Regs.COMPCTL.bit.COMPDACEN=1;
Comp1Regs.COMPCTL.bit.COMPSOURCE=0;
Comp1Regs.COMPCTL.bit.SYNCSEL=1;
Comp1Regs.COMPCTL.bit.QUALSEL=2;
Comp1Regs.DACVAL.bit.DACVAL=20;
EDIS;

2

COMP_Handle myComp1;

myComp1 = COMP_init((void *)COMP1_BASE_ADDR, sizeof(COMP_Obj));

COMP_enable(myComp1);
COMP_enableDac(myComp1);
COMP_setDacValue(myComp1, 20);

编译后 查看COMP寄存器 发现没有成功写入