Converting Les's interrupt timer to 18F25K22


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,277
    Thumbs Up
    Received: 16
    Given: 0
    Total Downloaded
    872.27 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. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,141
    Thumbs Up
    Received: 73
    Given: 173
    Total Downloaded
    4.98 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.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,277
    Thumbs Up
    Received: 16
    Given: 0
    Total Downloaded
    872.27 MB

    0 Not allowed!

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

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

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,329
    Thumbs Up
    Received: 287
    Given: 138
    Total Downloaded
    1.60 GB

    0 Not allowed!

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

    That is the number 1 problem with Microchip. They cannot leave SFRs alone, even when they do not need to be changed. This makes maintaining the compiler really difficult.

    An SFR that has been in the microcontrollers from their very start should not be changed in any way. If extra bits are required, a new SFR should be created with the extras. This would mean that all the PICs of the same family would run each others code. But that is far too sensible for current day companies. Just wait to see what Microchip do to Atmel devices. LOL They have stayed the same for many, many years, but just give it time, and Microchip will screw them up as well.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

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, 21: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 12th October 2019, 08:18 : 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