Hi Thomas and list, That was it. Thanks so much! I knew it had to be something simple I=20 wasn't even thinking about. Rob On 1/31/2012 1:54 PM, Thomas Sefranek wrote: > You DO realize there are registers NOT in the access page, right? > > Example code: > ; > ; Timer 5 is used as the time base for CCP5 to trigger the A-D. (30.5 Hz.= ) > ;----- T5CON Bits -------------------------------------------------------= -- > Init_TMR5 MOVLW 0X30 > ; BCF T5CON, TMR5CS1 ;<7> Timer 5 clock source is Fosc/4. > ; BCF T5CON, TMR5CS0 ;<6> Timer 5 clock source is Fosc/4. > ; BSF T5CON, T5CKPS1 ;<5> Prescale 1:8. > ; BSF T5CON, T5CKPS0 ;<4> Prescale 1:8. > ; BCF T5CON, T5SOSCEN ;<3> Timer 5 oscillator off. > ; BCF T5CON, NOT_T5SYNC ;<2> Unused. (Using internal clock.) > ; BCF T5CON, T5RD16 ;<1> Read timer 5 as 2 bytes. > ; BCF T5CON, TMR5ON ;<0> Disable Timer 5. > MOVFF WREG, T5CON > ; New in the K22 > MOVFF PMD0, WREG ; Fetch the current Power control register 0. > BCF WREG, TMR5MD ; Power on TIMER 5. > MOVFF WREG, PMD0 ; Save the adjusted Power control register 0. > ; > ;----- T5GCON Bits ----------------------------------------------------- > Init_T5G CLRF WREG > ; BCF T5GCON, TMR5GE ;<7> No gate function. > ; BCF T5GCON, T5GPOL ;<6> Gate is active LOW. > ; BCF T5GCON, T5GTM ;<5> Gate mode disabled. > ; BCF T5GCON, T5GSPM ;<4> Single pulse mode disabled. > ; BCF T5GCON, T5GGO_NOT_DONE ;<3> Timer 5 gate complete. > ; BCF T5GCON, T5GSS1 ;<1> Timer 5 gate pin, > ; BCF T5GCON, T5GSS0 ;<0> Source. > MOVFF WREG, T5GCON > ; > On Jan 31, 2012, at 4:42 PM, Rob wrote: > >> Hello List, >> I'm using a PIC18F26K22 with assembly and trying to use Timer 5 as a >> simple timer that generates an interrupt on rollover. In my application >> I am also using Timer 0,1 and 3 without problems. I basically duplicated >> the code I'm using for Timer 3 with relevant register changes and just >> can't seem to get Timer 5 to generate an interrupt. Is there something >> special about the way Timer 5 needs to be configured that is unique from >> say Timer 3? In the low level ISR code, I basically just use the >> interrupt to set a flag that I check in my main loop. Below is the code >> I am using to try to configure Timer 5: >> >> clrf TMR5H ;clear high byte of Timer5 16 bit register= s >> clrf TMR5L ;then clear low byte which reloads both >> registers >> bcf PMD0,TMR5MD ;Timer5 Peripheral Module Disable >> Control bit >> bcf T5CON,TMR5ON ;1=3DEnables Timer5 (initialize as disab= led) >> bcf T5GCON,TMR5GE ;Timer1/3/5 Gate Enable bit (0=3Dcounts >> regardless of gate) >> bcf T5GCON,T5GPOL ;Timer1/3/5 Gate Polarity bit >> bcf T5GCON,T5GSPM ;Timer1/3/5 Gate Single-Pulse Mode b >> bcf T5GCON,T5GSS1 ;Timer1/3/5 Gate Source Select bits >> bcf T5GCON,T5GSS0 ;Timer1/3/5 Gate Source Select bits >> bsf T5CON,T5RD16 ;1=3DEnables register read/write of Time= r5 >> in one 16-bit operation >> bsf T5CON,T5CKPS1 ;Timer5 Input Clock Prescale Select bit= s >> bsf T5CON,T5CKPS0 ;11 =3D 1:8 Prescale value >> bcf T5CON,TMR5CS1 ;Timer1/3/5 Clock Source Select bits >> bcf T5CON,TMR5CS0 ;Timer1/3/5 Clock Source Select bits >> bcf T5CON,T5SOSCEN ;Dedicated Secondary oscillator >> circuit disabled >> bcf T5CON,T5SYNC ;Timer1/3/5 External Clock Input >> Synchronization Control bit >> bcf IPR5,TMR5IP ;TMR5 Overflow Interrupt Priority >> bit. 1=3DHigh, 0=3DLow >> bcf PIE5,TMR5IE ;TMR5 Overflow Interrupt Enable bit. >> 1=3DEnable >> bcf PIE3,TMR5GIE ;TMR5 Gate Interrupt Enable bit. 1=3DEna= ble >> bcf PIR5,TMR5IF ;TMR5 Overflow Interrupt Flag bit. >> (must be cleared by software) >> >> ;make all defined interrupts active now >> bsf INTCON,GIEH ;Enables all high priority interrupts >> bsf INTCON,GIEL ;Enables all low priority peripheral >> interrupts >> >> Then later I call a subroutine that enables the timer" >> >> bcf PIE5,TMR5IE ;first, disable TMR5 Overflow >> Interrupt in case it's running >> clrf TMR5H ;clear high byte of Timer5 >> clrf TMR5L ;then clear low byte which reloads both >> registers >> bsf T5CON,TMR5ON ;Enables Timer5 >> bsf PIE5,TMR5IE ;enable TMR5 Overflow Interrupt >> >> Hope this is enough info so reveal my error. It must just be something >> simple that I'm over-looking but I've tried everything I can think of... >> >> Thanks, >> Rob >> >> --=20 >> http://www.piclist.com PIC/SX FAQ& list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist > * > | __O Thomas C. Sefranek wa1rhp@comcast.net > |_-\<,_ Amateur Radio Operator: WA1RHP > (*)/ (*) Bicycle mobile on 145.41 MHz. > > ARRL Instructor, Technical Specialist, VE Contact. > > http://www.harvardrepeater.org > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .