24EP256GP204 external interrupt problem


+ Reply to Thread
Results 1 to 13 of 13

Thread: 24EP256GP204 external interrupt problem474 days old

  1. #1
    tadd
    Guest tadd's Avatar

    0 Not allowed!

    Default 24EP256GP204 external interrupt problem

    hello friends, the problem is that there is a constant interrupt and the led flashes. I have a RP20 - porta.4 pullup resistor.


    How can I resolve it, where is the error?





    Code:
    Device = 24EP256GP204
    Declare Xtal = 140 
    
    
    PLL_Setup(76, 2, 2, $0300)
    Config FICD = ICS_PGD1, JTAGEN_OFF
    Config FPOR = ALTI2C1_ON, ALTI2C2_OFF
    Config FWDT = WDTPOST_PS256, WINDIS_OFF, PLLKEN_On, FWDTEN_OFF
    Config FOSC = POSCMD_NONE, OSCIOFNC_Off, IOL1WAY_OFF, FCKSM_CSECME
    Config FOSCSEL = FNOSC_FRCPLL, IESO_ON
    Config FGS = GWRP_OFF
    
    
    Symbol Led = PORTB.4
    Led = 0
    
    TRISA.4 = 1
    
    
    
    
    EX_INT:
    PPS_Input(cIn_Pin_RP20, cIn_Fn_INT1) 'a.4 = RP20
    Symbol INT1EP = INTCON2.1 = 1 'negative edge
    Symbol INT1IF = IFS0.3 = 0 ' flag
    IEC1.4 = 1      'INT1IE
    
    goto main
    
    Isr- INT1interrupt
    High Led
    DelayMS 300
    Low Led
    DelayMS 300
    INT1IF = 0
    EndIsr-
    
    main:
    delayms 500
    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.

  • #2
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,354
    Thumbs Up
    Received: 44
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Hi Tadd

    Are you sure that A.4 is the input? I would guess that a floating pin might cause the trouble you are having.

    Charlie

  • 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
    tadd
    Guest tadd's Avatar

    1 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    PPS_Input(cIn_Pin_RPI34, cIn_Fn_INT1) 'b.2 = RP34
    I tried it, I/O, led is still flashing

  • 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: 24EP256GP204 external interrupt problem

    Less help me

  • 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 GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    422
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    I think the first thing to check is whether the problem is hardware or software.
    The first thing is to measure with an oscilloscope on the A4 pin. If there is a pullup resistor this voltage should be 3V. You also have to see if it is a stable signal or there is associated noise that can vary this entry.

    If none of this happens and the signal on the A4 pin does not change then the problem is software.

    I do not know if this is legal or not. I always do it in different lines
    Symbol INT1EP = INTCON2.1 = 1 'negative edge
    Symbol INT1IF = IFS0.3 = 0 'flag

    Something like:
    Symbol INT1EP = INTCON2.1 'negative edge
    INT1EP = 1

    Another test option you can try is with a different pin

    Regards,
    Gamboa

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

  • #6
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    827
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    966.40 MB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Sadly I have no time for pic's at the moment :-( but a few suggestions anyway:



    First off it would be a good idea to have some way of checking that your pic is running ok, blinking a led, counting up on a display, that way you know your not wasting your time tracking down a problem when your pic isn't doing what you expect in the first place.

    Don't have delays in an interrupt, just set a flag and check that flag in your main code.

    I've not used that pic but I think there is more involved to set up that interrupt than you have in your code, you could also look at using an Input Change Interrupt, I found that easier.

  • 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
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    511
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.72 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    I have not played with 24 series devices much and not for over a year but I noticed you start you ISR with..
    Code:
    Isr- INT1interrupt
    where the syntax in the manual is...
    Code:
    Isr INT1Interrupt
    notice the absence of the hyphen and the capital I in Interrupt so try changing it to the above.

    Looking back my working code for the USB interrupt was
    Code:
    Isr USB1Interrupt

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

  • #8
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,232
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Stephen, did you get USB working on PIC24?
    George.

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

  • #9
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    511
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.72 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Quote Originally Posted by towlerg View Post
    Stephen, did you get USB working on PIC24?
    Not really, I was perhaps half way, the problem with wanting to use it as a host is it is damn complicated, consequently there is no help on the internet (unlike for slaves) as people give up either early on or before they even write a word of code. I actually managed to quickly get it to detect Device connect, disconnect, speed and I think Address the device but at that stage I kept encountering a never ending supply of Suspend interrupts.
    I think (without analysing the bus data) the problem was the write time for the 2 x 16 Alphanumeric display I was using to show status and progression through the code is too long for the PIC to service the 10mS (or is it uS?) ping system on the BUS to the slave device, as a result the slave kept going to sleep triggering the suspend interrupt putting me in a never ending loop...

    print status to display (slave goes to sleep) - service interrupt - print status to display (slave goes to sleep) - service interrupt

    To make further progress on it I need a USB bus analyser to record what happens on PC when it enumerates a device and compare that to the data on the PIC's USB bus so that I can see that the correct data is flowing. Fortunately I have access to a Bus analyser at work and my USBee logic analyser software also has USB bus protocol analyser which may help.
    My biggest problem is time, I have not touched the project for a couple of years and I really need to be able to work on it consistently for a few hours a week as with USB being very complicated for what is essentially an upgraded I2C bus if I am not working constantly on it I have to basically start from scratch each time, re-learning USB stuff and how my existing code works.

    I am hoping that once my current project as work is finished I will have some time to get back to it as it is an interesting project and I would like to get it working, fortunately I am only concerned with connecting to HID devices who's specifications are set in stone so I don't really need to worry about anything beyond the USB 2 specifications.
    Last edited by Stephen Moss; 28th August 2018 at 16:01.

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

  • #10
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,232
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Wow, sounds like you've done a ton of work. It's definatly 10ms not 10us.
    George.

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

  • #11
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,232
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Sometimes the world sucks, I get 4 thumbs up for an inane comment and Stephen is on the way to getting USB working on P24 and he get nothing, lets hope he doesn't care about such flippery.
    George.

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

  • #12
    Administrator Lester's Avatar
    Join Date
    Jan 2002
    Posts
    1,858
    Thumbs Up
    Received: 43
    Given: 4
    Total Downloaded
    1.60 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    Sometimes the world sucks, I get 4 thumbs up for an inane comment and Stephen is on the way to getting USB working on P24 and he get nothing, lets hope he doesn't care about such flippery.
    I dont want to hijack this thread, so lets not discuss here. However your 4 ThumbsUp are no longer. The users were spammers, trying to attract attention to their taglines....they succeeded, so they are no longer.
    Lester Wilson
    ---------------------------------
    Crownhill Associates Limited
    www.crownhill.co.uk
    Tel: +44 1353 749990
    Fax: +44 1353 749991
    [email protected]
    ----------------------------------

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

  • #13
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,232
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: 24EP256GP204 external interrupt problem

    The world is fair again, thanks Lester.
    George.

  • 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. 24EP256GP204 Timer3 external clock not working :(
      By tadd in forum Absolute Beginners Section
      Replies: 5
      Last Post: 13th July 2017, 09:59
    2. [SOLVED !] Problem with 18F14K50 external interrupt
      By Developer in forum Projects discussion
      Replies: 8
      Last Post: 21st September 2014, 21:54
    3. [SOLVED !] External eeprom problem - writing to all addresses
      By Dave-S in forum Proton Plus Compiler v3
      Replies: 13
      Last Post: 29th December 2011, 01:17
    4. [SOLVED !] TMR1 ..problem is to use an external oscillator???
      By vasili35 in forum The Lounge
      Replies: 16
      Last Post: 20th May 2011, 10:26
    5. External EEPROM READ/WRITE Problem
      By CharlieBrown in forum Proton Plus Compiler v3
      Replies: 3
      Last Post: 23rd July 2010, 10:34

    Posting Permissions

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