Tool/software: Code Composer Studio
Dear TI hello,
I am using a CMPSS7 to detect a threshold with a sinusoidal signal,
I connect the GPIO24 to the outputxbar1. threshold for the CMPSS High and Low is 0x800 and 0xc00,
Is there any thing wrong with my code,
In the Registers window in CSS i can see the high and low comparator status are moving, but the GPIO24, is always 1,
Thanks in advance for help,
S.Tarik,
EALLOW; /* Configuration analog inputs VPH1 */ /* CMPSS input MUX for CMP7 */ /* A10 sur CMP7HP and CMP7LP */ AnalogSubsysRegs.CMPHPMXSEL.bit.CMP7HPMXSEL = 0X00; AnalogSubsysRegs.CMPLPMXSEL.bit.CMP7LPMXSEL = 0X00; EDIS; EALLOW; /* Enable CMPSS */ Cmpss7Regs.COMPCTL.bit.COMPDACE = 1; /* High comparator input source is DAC */ Cmpss7Regs.COMPCTL.bit.COMPHSOURCE = 0X00; Cmpss7Regs.COMPCTL.bit.COMPLSOURCE = 0X00; /* High comparator output not inverted */ Cmpss7Regs.COMPCTL.bit.COMPHINV = 0x00; /* Low comparator output inverted */ Cmpss7Regs.COMPCTL.bit.COMPLINV = 0x01; /* High comparator asynchronous path NOT enableD */ Cmpss7Regs.COMPCTL.bit.ASYNCHEN = 0x00; // 0x01; /* Use VDDA as the reference for DAC */ Cmpss7Regs.COMPDACCTL.bit.SELREF = REFERENCE_VDDA; /* Set DAC to DACH TEST*/ Cmpss7Regs.DACHVALS.bit.DACVAL = p_uDacHigh; /* Set DAC to DACL for Test*/ Cmpss7Regs.DACLVALS.bit.DACVAL = p_uDacLow; /* Configure CTRIPOUTH output pin */ /* Configure OUTPUTXBAR1 to be CMPSS7.CTRIPOUTH */ OutputXbarRegs.OUTPUT1MUX0TO15CFG.bit.MUX12 = 0x00; /*Enable OUTPUTXBAR1 Mux for Output*/ OutputXbarRegs.OUTPUT1MUXENABLE.bit.MUX12 = 0X01; EDIS;