These new 16F18xx chips are small in the eye but really beasts!
I had my difficult time in setting them too, but nowI really like them.
Here is my setup for the 1827 which may help others to take into accoun the registers and not forget any of them.
Of course this is my setup and other need to make their own. It just as an example.
HTH,Code:TRISB = %11000101 TRISA = %11111100 ADCON0 = %00000001 ADCON1 = %11110011 ANSELA = %00011100 ' all digital. A/D disabled ANSELB = %01000000 APFCON0 = %00100000 APFCON1 = %00000001 BAUDCON = %00011000 CCP1CON = %00111100 'Control of CCPx modules CCP2CON = %00000000 CCP3CON = %00000000 CCP4CON = %00000000 CM1CON0.7=0 CM2CON0.7=0 CPSCON0 = 0 CPSCON1 = 0 DACCON0 = 0 FVRCON = %10000011 INTCON = %11000000 ' global & peripheral ints enabled OPTION_REG = %10000111 'Tmr0 from 256 presc and Int Clock PIR1 = 0 ' clear TMR1 int flag PIE1 = %00000001 ' TMR1 int enabled T1CON = %00110000 ' TMR1 1:8 prescale, timer1 on WPUB=%11000000 'hpwm 1,0,2000 DEFINE CCP1_REG PORTB DEFINE CCP1_BIT 3 ccptmrs=0 pr2=249 ccp1con=$0C
Ioannis




Bookmarks