RB0 interrupt and toggle issue


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Question

    It shouldn't affect portE which is where 2 of my relay pins are. I will try it anyway and let you know. Thanks for the suggestion!

    Nick

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Where is the PIC populated? Is it on any Microchip board?

    Ioannis

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Macgman2000 View Post
    It shouldn't affect portE which is where 2 of my relay pins are. I will try it anyway and let you know. Thanks for the suggestion!

    Nick
    Sure enough it will as PORTE<2:0> are multiplexed with AN<7:5>
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I went through and disabled everything and then some on portA and PortE. No dice. portA and PortE change from low to high but does not toggle. In fact it undoes any set pins on portA and E. It does not alter them at the bit level individually. My desired function is to latch individual pins in either 1 or 0 condition to energize a relay or de-energize it, through the decoding of local switch presses. I need to take a step back or something....thanks for your help guys.

    Nick

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    I repeat my question. Do you have any dev. kit or use your own PCB design?

    Ioannis

  6. #6


    Did you find this post helpful? Yes | No

    Question

    The micro is on a circuit board. It uses a 20Mhz resonator and I am using in-circuit-programming. All ports are on header pins and not tied to anything, except for the button switches which are pulled low via 10k resistors. I have physical jumpers to put the hardware into ICP mode and then back to normal mode. I can set ports when the interrupt routine is called on any button press, but it does not decode the content of the variable I place the key press in to. IE, it blasts through conditional statements.

    I can set bit wise port A and Port E within the interrupt. If within the interrupt I set portA (your bit of choice) and then use a conditional statement to reset portA (your chosen bit) if the bit is set...it does nothing....the port bit stays set. Toggle does nothing to alter the port logic level output.

    Very strange.
    Last edited by Macgman2000; - 3rd May 2009 at 20:21. Reason: toggle issue

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    OK i have had an eintesy bit of success with your code.
    To your config statement add _DEBIG_ON and ADD TRISB = %00000001 so the B.0 interrupt will work. I am not saying this will fix it, but it needs those fixes, gotta run, Gotta Barbeque.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8


    Did you find this post helpful? Yes | No

    Question interrupts

    Ok for my own sanity, I would like confirmation on my understanding of how RB0 interrupt works or any interrupt for that matter. Once an interrupt condition happens, the interrupt flag is set, then the code is vectored to the interrupt start location.

    In my code, I do the customary saving status, pclath..etc. Then I run my code, then repack status and pclath.
    Retfie statement at the end of the interrupt clears the interrupt flag so now it is enabled to recieve interrupts. So during the time I am running my code in the interrupt, it shouldn't be retriggering the interrupt based on switch bounce until it sees Retfie....or does it? Somewhere, somehow the contents of the variable that I am passing to the case statements is getting hosed (I assume). The variable is specfied as bank0 System, so content must be common across banks.....or is it?

    Lots of questions, I guess I am second guessing everything now.

    Nick

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 11:48
  3. I have problem with interrupt RB0
    By chai98a in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th July 2008, 09:55
  4. tmr2 interrupt problem
    By ADCON in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 2nd January 2008, 18:49
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 0

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