Pic18F87k22 xtal prescaler timer1 problems

Thread Starter

Picbuster

Joined Dec 2, 2013
1,047
When a xtal 32kxxxkhz is used the prescaler for timer 1 seems not to be able to handle 1:1 see my T1CON settings . It does 1/2 that speed
The xtal is ' in circuit' measured and does the correct frequency.
Also tested with no xtal to make sure that the choice of source was correct.

T1CON=0b10001111; // bit 7 set conform manual.

if (TMR1IF)
{

TMR1IF=0; // allways running
TMR1H=128; // in seconden
Alive_led = !Alive_led;
}

However: it works correct with PIC18F8722 but with T1CON=0b00001111; // as set conform manual
Both boards same hardware but pwr changed conform manual.
Software successfully ported from 8722 to 87k22 changes done conform manual.
(Timer 1 only problem. Easy to program around but that's not the correct way)


I don't understand this problem
Known problem or to sleepy to find the solution?

Whom has the answer?

Picbuster
 

Thread Starter

Picbuster

Joined Dec 2, 2013
1,047
What speed does the LED flash for each chip?
Repeat the count with the 'TMR1H=128' line commented out.
Tested it: blank out TMR1H has no effect remains 2 seconds however; manual indicates read and writable (as working in the 8722).

4.0 TIMER1 MODULE The Timer1 timer/counter module incorporates these features:
• Software-selectable operation as a 16-bit timer or counter
• Readable and writable 8-bit registers (TMR1H and TMR1L)
• Selectable clock source (internal or external) with device clock or SOSC oscillator internal options• Interrupt-on-overflow
• Reset on ECCP Special Event Trigger• Timer with gated control

Microchip is good so I missed something but what?
a: brains.
b:finding the correct information.
c:problem with chip.

Picbuster
 

Thread Starter

Picbuster

Joined Dec 2, 2013
1,047
What speed does the LED flash for each chip?
Repeat the count with the 'TMR1H=128' line commented out.
I did found my brains back!!!!
Problem; the RD16 set one 16 bit counter or two 8 bytes counter ( hi and lo byte).
After selecting two 8 bytes problem solved.

Thanks for your remark about blanking out the Hi byte that did produce a reset to my little brains.

Picbuster
 
Top