Elapsed timer not working as expected at 64MHz


Results 1 to 40 of 56

Threaded View

  1. #13
    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 as expected at 64MHz

    Was looking at T1CON register and noticed this:

    TxCKPS<1:0>: Timer1/3/5 Input Clock Prescale Select bits
    11 = 1:8 Prescale value
    10 = 1:4 Prescale value
    01 = 1:2 Prescale value
    00 = 1:1 Prescale value
    So that is 2 bits.


    Code:
    bit 7-6 TMRxCS<1:0>: Timer1/3/5 Clock Source Select bits
      11 =Reserved. Do not use.
      10 =Timer1/3/5 clock source is pin or oscillator:
        If TxSOSCEN = 0:
          External clock from TxCKI pin (on the rising edge)
        If TxSOSCEN = 1:
          Crystal oscillator on SOSCI/SOSCO pins
      01 =Timer1/3/5 clock source is system clock (FOSC)
      00 =Timer1/3/5 clock source is instruction clock (FOSC/4)
    
    bit 5-4 TxCKPS<1:0>: Timer1/3/5 Input Clock Prescale Select bits
      11 = 1:8 Prescale value
      10 = 1:4 Prescale value
      01 = 1:2 Prescale value
      00 = 1:1 Prescale value
    
    bit 3 TxSOSCEN: Secondary Oscillator Enable Control bit
      1 = Dedicated Secondary oscillator circuit enabled
      0 = Dedicated Secondary oscillator circuit disabled
    
    bit 2 TxSYNC: Timer1/3/5 External Clock Input Synchronization Control bit
        TMRxCS<1:0> = 1X
      1 = Do not synchronize external clock input
      0 = Synchronize external clock input with system clock (FOSC)
        TMRxCS<1:0> = 0X
      This bit is ignored. Timer1/3/5 uses the internal clock when TMRxCS<1:0> = 1X.
    
    bit 1 TxRD16: 16-Bit Read/Write Mode Enable bit
      1 = Enables register read/write of Timer1/3/5 in one 16-bit operation
      0 = Enables register read/write of Timer1/3/5 in two 8-bit operation
    
    bit 0 TMRxON: Timer1/3/5 On bit
      1 = Enables Timer1/3/5
      0 = Stops Timer1/3/5
        Clears Timer1/3/5 Gate flip-flop
    T1CON=00000000

    Robert
    Last edited by Demon; - 23rd December 2014 at 03:42.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

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