Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/TMS320F280049: CMPSS will not run

$
0
0

Part Number: TMS320F280049

Tool/software: Code Composer Studio

Hello,

I do not get the CMPSS unit in a F280049 to run as requested by the code and would be thankful for any help.

I want to realize a simple example to test the functionality of the comparator module. It should use the DAC to realize a reference and should use VDDA as reference source. In the end I want to see a toggling COMPHSTS value for CMPSS3 in Code Composer, with respect to the given DACVAL and the analog value on Pin 7 of the package. My initialization is as follows.

//Interconnect the Comparator Pins
	AnalogSubsysRegs.CMPHPMXSEL.bit.CMP3HPMXSEL = 0;
	AnalogSubsysRegs.CMPLPMXSEL.bit.CMP3LPMXSEL = 0;
	AnalogSubsysRegs.CMPHPMXSEL.bit.CMP4HPMXSEL = 0;
    AnalogSubsysRegs.CMPLPMXSEL.bit.CMP4LPMXSEL = 0;

    //Enable CMPSS
    Cmpss3Regs.COMPCTL.bit.COMPDACE = 0x1;

    //Choose Comperator negative input
    Cmpss3Regs.COMPCTL.bit.COMPHSOURCE = 0;

    //Choose inverting CMP out
    Cmpss3Regs.COMPCTL.bit.COMPHINV = 0;

    // Hysteresis Setting
    Cmpss3Regs.COMPHYSCTL.bit.COMPHYS = 0;

    //Use VDDA as the reference for DAC
    Cmpss3Regs.COMPDACCTL.bit.SWLOADSEL = 0;
    Cmpss3Regs.COMPDACCTL.bit.DACSOURCE = 0;
    Cmpss3Regs.COMPDACCTL.bit.SELREF = 0;

    // Configure Digital Filter High
    Cmpss3Regs.CTRIPHFILCLKCTL.bit.CLKPRESCALE  = 0x0;
    Cmpss3Regs.CTRIPHFILCTL.bit.SAMPWIN         = 0x0;
    Cmpss3Regs.CTRIPHFILCTL.bit.THRESH          = 0x0;
    //Reset filter logic & start filtering
    Cmpss3Regs.CTRIPHFILCTL.bit.FILINIT         = 0x1;

    // Configure Latch High
    Cmpss3Regs.COMPCTL.bit.ASYNCHEN             = 0x0;
    Cmpss3Regs.COMPDACCTL.bit.RAMPSOURCE        = 0x0;
    Cmpss3Regs.COMPSTSCLR.bit.HSYNCCLREN        = 0x0;

While the AD unit is working fine the CMPSS unit isn't working at all. The Cmpss3Regs.COMPSTS vales do not change with alternating analogue value or given compare value. Could somone please provide a minimum example or give me a clue on my not working code?

Thanks,
Martin


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>