Converting Les's interrupt timer to 18F25K22


Yesterday 23:03
Forum: Proton Plus Compiler v3
Starter: gdesantis
Views: 0
Replies: 3
Yesterday 20:28
Forum: PICKit Plus
Starter: evan
Views: 0
Replies: 7
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,212
    Thumbs Up
    Received: 18
    Given: 0
    Total Downloaded
    614.99 MB

    0 Not allowed!

    Default Converting Les's interrupt timer to 18F25K22

    Les's original code is here in post #30

    http://www.protonbasic.co.uk/showthr...-seconds/page3.

    Following on from another thread I decided to try Les’s timer on an 18F25K22.

    It took me a while to figure out the changes needed to make it work. Typical of Microchip register T3CON is completely different from the 18F25K20, see page 172 of the 18F25K22 manual.

    So instead of T3CON = $FD (%0011 1101) we need T3CON = $37 (%0011 0111)

    The next bit was much harder to work out. There is a new register that selects the timer source for the CCP modules. See page 208 of the data sheet.

    Bits 4 and 3 select the timer for CCP2 so we need a new line so after CCP2CON = $0B add the new line CCPTMRS0 = $8 ‘ (%0000 1000)

    I see that the forum editor still trashes % followed by zero zero if you are not careful, I had to edit a couple of times to correct the missing bits
    Last edited by See_Mos; 15th October 2018 at 16:04.
    My RAM is failing

  2. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,853
    Thumbs Up
    Received: 163
    Given: 162
    Total Downloaded
    3.24 GB

    0 Not allowed!

    Default Re: Converting Les's interrupt timer to 18F25K22

    See Mos, you can prevent the board software from trashing percent signs by switching the editor to source mode.
    George

  3. #3
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,212
    Thumbs Up
    Received: 18
    Given: 0
    Total Downloaded
    614.99 MB

    0 Not allowed!

    Default Re: Converting Les's interrupt timer to 18F25K22

  4. Thanks for the reminder George, I have mentioned the problem previously but my RAM is failing to update.
    My RAM is failing

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Interrupt timer count down and up
    By amateurtje in forum Absolute Beginners Section
    Replies: 17
    Last Post: 10th September 2014, 09:17
  2. Variables from main program not availeble in interrupt (18F25K22)
    By Stijn in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 25th March 2013, 22:19
  3. HbusOut in a Timer interrupt
    By pic-ignorant in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 25th July 2012, 19:13
  4. Need help with timer interrupt
    By DaOne in forum Proton Plus Compiler v3
    Replies: 8
    Last Post: 13th May 2012, 22:01
  5. Interrupt timer
    By Jezsmith in forum Proton Plus Compiler v3
    Replies: 17
    Last Post: 31st July 2010, 09:20

Members who have read this thread since 7th December 2018, 07:57 : 0

Actions :  (Set Date)  (Clear Date)

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