RB0 interrupt and toggle issue


Closed Thread
Results 1 to 36 of 36

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Macgman2000 View Post
    OK it compiled but still does not work. Meaning....A key press yeilds no toggling of ports. It gets to the interrupt (I placed a porta.0 = 1 flag) so I know that part is working just like the PBP interrupt handler when any key is pressed. The problem is nothing toggles or the payload value of the keypress is corrupted. I inserted pause 1000 for debounce but that didn't work either. It seems to be blasting right by the conditional statements and exiting the interrupt.

    Man this is frustrating!
    As I said before I have had toggle not work. Perhaps you can use a bitwise ^ to flip the bit. Try looking at the variables contents using a serout or debugout and see if it contains the value it is supposed to have. I will look at this tonight after I come home from dinner.
    Last edited by Archangel; - 1st May 2009 at 01:14.
    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.

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


    Did you find this post helpful? Yes | No

    Default

    Toggle doesn't work because you have'nt disable the ADCs.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Toggle doesn't work because you have'nt disable the ADCs.
    Hahaha I just stumbled across one of Melanies posts mentioning that, http://www.picbasic.co.uk/forum/showthread.php?t=977
    This chip has CCP module on portC. Good call Steve.
    Last edited by Archangel; - 1st May 2009 at 01:29.
    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.

  4. #4


    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

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


    Did you find this post helpful? Yes | No

    Default

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

    Ioannis

  6. #6
    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.

  7. #7


    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

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    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

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