Elapsed timer not working as expected at 64MHz


Closed Thread
Results 1 to 40 of 56

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: Elapsed timer not working at 64MHz

    hi robbert
    it was not released specifically for the elapsed timer , as that code uses timer 1 ,
    and both versions must be maintained as the K22 version is specific to the registers that have changed for the K22 series

    the ints-18_K22 version was on His site from memory


    The modified version is used specifically on the 18fxxK22 ,for the following reasons

    1. TMR4 - changed from PIR3 to PIR5 in K22 ver
    2. TMR5 and TMR6 support added to support the addtional timers in the K22 series
    3. ccp3 , ccp4,ccp5 - changed PIR3 to PIR4 in the K22 range


    this is confirmed when comparing DT_INTS-18 AND dt_INTS-18_K22 of the code

    the addtional / changed code in K22 version is as follows


    regards

    Sheldon

    Code:
      #define TMR4_INT  PIR5, TMR4IF    ;-- TMR4 to PR4 Match
    #define TMR5_INT  PIR5, TMR5IF    ;-- TMR5 Overflow 
      #define TMR6_INT  PIR5, TMR6IF    ;-- TMR6 to PR6 Match
    ccp3- ccp5 , uses PIR4 in the K22 , where other f18 use PIR3

    Code:
     #define CCP3_INT  PIR4, CCP3IF    ;-- CCP3 
      #define CCP4_INT  PIR4, CCP4IF    ;-- CCP4 
      #define CCP5_INT  PIR4, CCP5IF    ;-- CCP5
    further support for the changed TMR4 and extra timers 5 and 6 in k22 range

    Code:
    ifdef TMR4IF  ;----{ TMR4 Overflow Interrupt }------------[PIR5, TMR4IF]---
          INT_Source  PIR5,TMR4IF, PIE5,TMR4IE, IPR5,TMR4IP
      endif
    
     ifdef TMR5IF  ;----{ TMR5 Overflow Interrupt }------------[PIR5, TMR5IF]---
          INT_Source  PIR5,TMR5IF, PIE5,TMR5IE, IPR5,TMR5IP
      endif
      ifdef TMR6IF  ;----{ TMR6 Overflow Interrupt }------------[PIR5, TMR6IF]---
          INT_Source  PIR5,TMR6IF, PIE5,TMR6IE, IPR5,TMR6IP
      endif
    again further support of the changed interupt register from normal 18f pics ( PIR3) to that of the K22 (PIR4) for the CCP3-5

    Code:
      ifdef CCP3IF  ;----{ CCP3 Interrupt Flag }----------------[PIR4, CCP3IF]---
          INT_Source  PIR4,CCP3IF, PIE4,CCP3IE, IPR4,CCP3IP
      endif
      ifdef CCP4IF  ;----{ CCP4 Interrupt Flag }----------------[PIR4, CCP4IF]---
          INT_Source  PIR4,CCP4IF, PIE4,CCP4IE, IPR4,CCP4IP
      endif
      ifdef CCP5IF  ;----{ CCP5 Interrupt Flag }----------------[PIR4, CCP5IF]---
          INT_Source  PIR4,CCP5IF, PIE4,CCP5IE, IPR4,CCP5IP
      endif

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Elapsed timer not working at 64MHz

    ...this is confirmed when comparing DT_INTS-18 AND dt_INTS-18_K22 of the code...
    Ok, so the K22 version is for the main DT_INTS-18 include, not the DT_Elapsed-18 include. I hadn't understood that.

    Robert

Similar Threads

  1. I2CRead & I2CWrite not working as expected
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 30
    Last Post: - 27th October 2021, 19:36
  2. PORTB.3 Input not working as expected.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th March 2013, 10:58
  3. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 18:39
  4. SPWM and Elapsed Timer
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 8th May 2008, 04:16
  5. DT Elapsed Timer
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th March 2008, 00:17

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts