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.

CCS/TMS320F28377S: ramp generation using the comparator module

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

how can i use the ramp generator in cmpss to work instead of the dacvala register?

is there a way such that i can use the digital filter in cmpss code  for the giving the ramp generation 

in the pre-existing code for cmpss digital filter -

void InitCMPSS(void)
{
EALLOW;

//
//Enable CMPSS
//
Cmpss1Regs.COMPCTL.bit.COMPDACE = 1;

//
//NEG signal comes from DAC
//
Cmpss1Regs.COMPCTL.bit.COMPHSOURCE = NEGIN_DAC;

//
//Use VDDA as the reference for DAC
//
Cmpss1Regs.COMPDACCTL.bit.SELREF = REFERENCE_VDDA;

//
//Set DAC to midpoint for arbitrary reference
//
Cmpss1Regs.DACHVALS.bit.DACVAL = 2048;

//
// Configure Digital Filter
//Maximum CLKPRESCALE value provides the most time between samples
//
Cmpss1Regs.CTRIPHFILCLKCTL.bit.CLKPRESCALE = 0x3FF;

//
//Maximum SAMPWIN value provides largest number of samples
//
Cmpss1Regs.CTRIPHFILCTL.bit.SAMPWIN = 0x1F;

//
//Maximum THRESH value requires static value for entire window
// THRESH should be GREATER than half of SAMPWIN
//
Cmpss1Regs.CTRIPHFILCTL.bit.THRESH = 0x1F;

//
//Reset filter logic & start filtering
//
Cmpss1Regs.CTRIPHFILCTL.bit.FILINIT = 1;

//
// Configure CTRIPOUT path
// Digital filter output feeds CTRIPH and CTRIPOUTH
//
Cmpss1Regs.COMPCTL.bit.CTRIPHSEL = CTRIP_FILTER;
Cmpss1Regs.COMPCTL.bit.CTRIPOUTHSEL = CTRIP_FILTER;

//
// Configure CTRIPOUTH output pin
//Configure OUTPUTXBAR3 to be CTRIPOUT1H
//
OutputXbarRegs.OUTPUT3MUX0TO15CFG.all &= ~((Uint32)1);

//
//Enable OUTPUTXBAR3 Mux for Output
//
OutputXbarRegs.OUTPUT3MUXENABLE.all |= (Uint32)1;
EDIS;
}

c

there is no inclusion of any code for choosing the the source of compH_n from dac or ramp generator 

COMPDACCTL.bit.DACSOURCE = 1;  //for selecting the ramp generator as a source

  • Hi Surya,

    All the information you are looking for is indicated on the CMPSS block diagram. If a connection is not indicated on the block diagram, then it can't be done. Below is the CMPSS block diagram. The highlighted areas show the registers you need to change to use the ramp generator with comph. Ramp generator is not available for compl.

    No, the digital filter cannot generate the ramp. The connection you see going from the digital filter to the ramp generator is used for synchronization purposes. 

  • from the above i'm making these inferences .
    1)for a comph ,i can use the ramp generator , in tandem with the synch / asynch mode (instead of digital filter)
    2)and can i use this part of syntax to change the connection from the dacvals torampgen as the o/p

    COMPDACCTL.bit.DACSOURCE = 1;
  • 1)for a comph ,i can use the ramp generator , in tandem with the synch / asynch mode (instead of digital filter)

    Yes but only sync and filter only and not asynch.


    2)and can i use this part of syntax to change the connection from the dacvals torampgen as the o/p

    COMPDACCTL.bit.DACSOURCE = 1;

    Yes.