And shouldn't the PEIE bit in INTCON be set also? Not sure of that one=20 without the datasheet in front of me. BB William Bross wrote: >Hi Neil, >I gave it a quick scan and it looks pretty straightforward to me. Is=20 >your port bit set to an output? Toggling the LAT reg? >Bill > > >Neil wrote: > > =20 > >>Would appreciate a fresh pair of eye here please, as I must be missing=20 >>something very basic. >> >>I'm using Timer4 on a 18F24K22 to generate repeated pulses (C18 v3.46),=20 >>but changing the PR4 match value does not seem to have any effect, and=20 >>changing the prescale value seems to give odd results. This is a brief=20 >>section of what I have... >> >> T4CON =3D 0b00000101; >> PR4 =3D 50; >> PIE5bits.TMR4IE =3D 1; >> RCONbits.IPEN =3D 0; // Disable interrupt priorities >> INTCONbits.GIE =3D 1; >> >>The interrupt service routine... >> if (PIR5bits.TMR4IF) >> { >> ... < Toggle PORT bit here for logic analyzer > ... >> ... other code here ... >> PIR5bits.TMR4IF =3D 0; >> } // Timer-1 interrupt >> >>With this, I get regular pulses on the logic analyzer. >>Changing PR4 has no effect on the timing. >>Now, if I change T4CON to 0b00001101, nothing changes. 0b00010101=20 >>also. 0b00110101 changes the timing though, to double the previous perio= d. >>I tried Timer-2 similarly and got the same results. >>Currently I've worked around the issue by using timer-1, but would like=20 >>to know what's going on here. >> >>Anyone see what am I missing here? >> >>Cheers, >>-Neil. >> >> >> >> >> >> >>=20 >> >> =20 >> > > =20 > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .