I am unable to get the external 32.768kHz crystal (on RB6 and RB7) / timer1 to function (PIC16F628A / Mikro C). The crystal never starts. The same circuit has been reproduced twice (with short crystal connections, correct value capacitors etc) and the issue is the same.
The code I currently have working (running on the internal 4MHz), changing TMR1CS to 1 results in no timer function, no crsytal start.
TMR1L = 0;
TMR1H = 0;
T1CON.T1CKPS0 = 1; // Set Timer 1 prescaler
T1CON.T1CKPS1 = 1; // TICKPS0 & TICKPS1 set to 1 (for /8 prescale), not 0
//T1CON.TMR1CS = 1;
T1CON.TMR1CS = 0; //Use internal OSC for testing
T1CON.T1OSCEN = 1;
//T1CON = 0b00001111;
CCP1CON = 0b00001011; // Timer 1 compare mode, Special Event mode
CCPR1L = (16383 & 0x00FF); // Preset compare register low/high bytes
CCPR1H = (16383 & 0xFF00)>>8;
This, not working
TMR1L = 0;
TMR1H = 0x80;
T1CON.T1CKPS0 = 0; // Set Timer 1 prescaler
T1CON.T1CKPS1 = 0; // RJ TICKPS0 & TICKPS1 set to 1 (for /8 prescale), not 0
T1CON.TMR1CS = 1;
//T1CON.TMR1CS = 0; //RJ Use internal OSC for testing
T1CON.T1OSCEN = 1;
//T1CON = 0b00001111;
CCP1CON = 0b00001011; // Timer 1 compare mode, Special Event mode
CCPR1L = (16383 & 0x00FF); // Preset compare register low/high bytes
CCPR1H = (16383 & 0xFF00)>>8;
Does anyone have a tested / working scenario from which they can provide the precise settings for T1CON and the config bits? I have followed the Microchip timer1 sheet to the letter and this is still not working.
Regards Active