pic24EP timer macros and example


+ Reply to Thread
Results 1 to 5 of 5

Thread: pic24EP timer macros and example1099 days old

  1. #1
    tadd
    Guest tadd's Avatar

    0 Not allowed!

    Default pic24EP timer macros and example

    hello friends

    i need pic24EP timer macros and example, i could not find, where ?

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.

  • #2
    tadd
    Guest tadd's Avatar

    0 Not allowed!

    Default Re: pic24EP timer macros and example

    Quote Originally Posted by tadd View Post
    hello friendsi need pic24EP timer macros and example, i could not find, where ?
    '

    if proc and isr macro enabled timer is not work, where is the mistake?
    Code:
    'Proc Timer2_config()     
    PMD1.12 = 1                     'timer2 off
    T2CON.15 = 0
    T2CON.3 = 0                    '0 = Timerx and Timery act as two 16-bit timers
    T2CON.15 = 0                  '1 = Starts 32-bit Timerx/y
    T2CON.6 = 1
    T2CON.4 = 1
    T2CON.5 = 1
        
    IFS0.7 = 0                         'Clear the Timer2 flag
    IEC0.7 = 1                         ' Enable the Timer2 interrupt
        
    TMR2 = 1000                      ' Clear Timer3 
    PR2 = 65535                      ' Period value                         
    PMD1.12 = 0                      'timer2 on
    T2CON.15 = 1
    'EndProc
    
    
    'Isr T2Interrupt
    'Toggle PORTC.6
    'Toggle PORTB.11
    'Clear IFS0bits_T2IF
    'EndIsr
    
    main:
    
    
    If IFS0bits_T2IF = 1 Then IFS0.7 = 0
    
    GoTo main

  • 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
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    831
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    966.48 MB

    0 Not allowed!

    Default Re: pic24EP timer macros and example

    I'm not exactly sure what you are asking but I can see you are trying to set up a 32 bit timer.

    I think your issue may be this which took me a while to work out: When you set up a 32 bit timer using T2 and T3 all the settings are made with timer 2 BUT the interrupt is generated on timer 3.

  • 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.

  • #4
    tadd
    Guest tadd's Avatar

    0 Not allowed!

    Default Re: pic24EP timer macros and example

    Quote Originally Posted by SimonJA View Post
    I'm not exactly sure what you are asking but I can see you are trying to set up a 32 bit timer.

    I think your issue may be this which took me a while to work out: When you set up a 32 bit timer using T2 and T3 all the settings are made with timer 2 BUT the interrupt is generated on timer 3.
    i only want to try timer 2 and timer 2 interrupt. 16bit timer

    You say timer 2 has not interrupt or interrupt will not work without timer3? and if you want have interrupt you must use T2 and T3 togather and timer 3 has interrupt

    did i understand right?

  • 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
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    831
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    966.48 MB

    0 Not allowed!

    Default Re: pic24EP timer macros and example

    My suggestion is only relevant for a 32 bit timer (I saw you mention 32 bit in you comments).

    One thing I noticed is you don't set an interrupt priority level, this is set in the IPC registers and if you don't set it the interrupt source is dissabled.

  • 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. Odd problem with Timer Macros
      By johngb in forum Proton Plus Compiler v3
      Replies: 5
      Last Post: 7th July 2012, 03:38
    2. Timer Macros - issue with Timer3 macro and 18F452
      By johngb in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 17th January 2012, 11:31
    3. Timer Macros
      By johngb in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 30th December 2011, 20:01
    4. [SOLVED !] looks great Timer Macros .... can you give an example of its use
      By Dphil7532 in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 13th June 2010, 20:46

    Tags for this Thread

    Posting Permissions

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