MicroChip Sample Code setting Current to a CMPDAC, DAC threshold which expect an voltage

Posted by jason hong on Stack Overflow See other posts from Stack Overflow or by jason hong
Published on 2013-06-29T22:19:40Z Indexed on 2013/06/29 22:21 UTC
Read the original article Hit count: 246

Filed under:

Sorry, the MicroChip Forum is very slow,I prefer to use overflow site to ask questions.

dsPIC33FJ06GS101/X02 and dsPIC33FJ16GSX02/X04    device 

 Sample Code   
              // configure comparator2  


    CMPCON2bits.CMPON = 1;   // enable comparator 
CMPCON2bits.INSEL = 1;   // select CMP2B input pin (RB0) 
CMPCON2bits.RANGE = 1;   // select high range, max DAC value = Avdd/2        
//CMPDACx: COMPARATOR DAC CONTROL REGISTER        
//CMREF<9:0>: Comparator Reference Voltage Select bits 
CMPDAC2 = CURR_HWLIM;    // DAC threshold 


  #define CURR_HWLIM 1023 // 1023 // 10.15 * 101A  

MicroChip Sample code setting CURR_HWLIM which 1023A to COMPDAC2 which expects voltage

I think that's mistake.

© Stack Overflow or respective owner

Related posts about microchip