Hi Neil, I am not 100% sure if your issue is resolved. Just curious so I can stop or keep looking. Cheers Justin On 20 August 2015 at 09:19, Neil wrote: > I'll add that I was getting interrupts before because I also had a > timer-0 interrupt running. > > Cheers, > -Neil > > > On 8/19/2015 9:03 PM, Neil wrote: > > Got it. Apparently PEIE *is* required when I'm not using interrupt > > priorities (compatibility mode). > > > > Cheers, > > -Neil. > > > > > > On 8/19/2015 7:06 PM, Neil wrote: > >> According to the datasheet, I don't need PEIE for timer 2. I'm not > >> setting it and I am still getting the port bit toggling... it's just n= ot > >> changing as I change PR4. > >> Page 114 here... > http://ww1.microchip.com/downloads/en/DeviceDoc/41412F.pdf > >> > >> I need to go investigate the priorities in detail again. > >> > >> Cheers, > >> -Neil. > >> > >> > >> > >> On 8/19/2015 5:55 PM, William Bross wrote: > >>> And shouldn't the PEIE bit in INTCON be set also? Not sure of that o= ne > >>> 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. I= s > >>>> your port bit set to an output? Toggling the LAT reg? > >>>> Bill > >>>> > >>>> > >>>> Neil wrote: > >>>> > >>>> > >>>> > >>>>> Would appreciate a fresh pair of eye here please, as I must be > missing > >>>>> something very basic. > >>>>> > >>>>> I'm using Timer4 on a 18F24K22 to generate repeated pulses (C18 > v3.46), > >>>>> but changing the PR4 match value does not seem to have any effect, > and > >>>>> changing the prescale value seems to give odd results. This is a > brief > >>>>> 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 > >>>>> also. 0b00110101 changes the timing though, to double the previous > period. > >>>>> I tried Timer-2 similarly and got the same results. > >>>>> Currently I've worked around the issue by using timer-1, but would > like > >>>>> to know what's going on here. > >>>>> > >>>>> Anyone see what am I missing here? > >>>>> > >>>>> Cheers, > >>>>> -Neil. > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=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 .