18f27k40 - timer0 changes from K22, K80 series 8bit/16bit mode


Results 1 to 11 of 11

Threaded View

  1. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: 18f27k40 - timer0 changes from K22, K80 series 8bit/16bit mode

    @ fosc=16mhz settings from mcc for a 10mS timer
    pic18f25k22
    Code:
     // Set TMR0 to the options selected in the User Interface
        // TMR0H 0; 
        TMR0H = 0x00;
        // TMR0L 100; 
        TMR0L = 0x64;
     
        // Load TMR0 value to the 8-bit reload variable
        timer0ReloadVal = 100;
        // Clearing IF flag
        INTCONbits.TMR0IF = 0;
        // T0PS 1:256; T08BIT 8-bit; T0SE Increment_hi_lo; T0CS FOSC/4; TMR0ON enabled; PSA assigned; 
        T0CON = 0xD7;
    18f27k40
    Code:
           // Set TMR0 to the options selected in the User Interface
    
        // T0CS FOSC/4; T0CKPS 1:64; T0ASYNC synchronised; 
        T0CON1 = 0x46;
    
        // TMR0H 155; 
        TMR0H = 0x9B;
    
        // TMR0L 0; 
        TMR0L = 0x00;
    
        // Clearing IF flag
        PIR0bits.TMR0IF = 0;
    
        // T0OUTPS 1:1; T0EN enabled; T016BIT 8-bit; 
        T0CON0 = 0x80;
    Last edited by richard; - 22nd July 2018 at 00:32.
    Warning I'm not a teacher

Similar Threads

  1. 18f27k40 - adc settings
    By longpole001 in forum PBP3
    Replies: 5
    Last Post: - 12th July 2018, 11:34
  2. PBP for dsPIC 16bit??
    By photoelectric in forum PBP Wish List
    Replies: 33
    Last Post: - 9th July 2014, 08:13
  3. PIC18f2620 Timer0 in 16-bit mode
    By Bruce in forum General
    Replies: 0
    Last Post: - 18th August 2010, 03:08
  4. AD7705 is 15bit or 16bit ADC
    By ravindrajoga in forum Off Topic
    Replies: 1
    Last Post: - 13th July 2007, 14:09
  5. 8bit var holds 16bit data!??
    By mofarngo in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th August 2005, 20:33

Members who have read this thread : 1

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