I haven't tried the sampling/averaging fix yet. I'm having some trouble with the new 16F616. With the 16F676, the only problem I had was with the pot not wanting to settle. Now, there's all kinds of problems with the 16F616. It seems like the primary difference between the two chips are the comparators. I'm a little confused by the differences between the 16F676's CMCON register and the 16F616's CM1CON0 and CM2CON0 registers. Seems like if I want CM1CON0 to be configured the same as CMCON = %00000111, I would write it as CM1CON0 = %00000000, but the last 2 bits are a little confusing to me. Do I need to configure both the CM1CON0 and CM2CON0 registers?
Also, could the way I have ADCON1 configured be causing trouble? Seems like FOSC2 is what I want. Faster is better, right?
Below is the configuration section of my code for the 16F616. Sorry for so many questions. I'm still pretty new to this.
Code:
#config
__CONFIG _CP_OFF & _WDTE_OFF & _BOREN_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT & _MCLRE_OFF
#endconfig
ADCON1 = %00000000
ANSEL = %00000110
CM1CON0 = %00000000 'program worked previously with 16F676 CMCON = %00000111
TRISA = %00001111
TRISC = %00000000
' Set TMR0 to interrupt every 16.384 milliseconds
OPTION_REG = %10000101 ' Set TMR0 configuration and enable PORTB pullups
INTCON = %10100000 ' Enable TMR0 interrupts
On Interrupt Goto tickint
Bookmarks