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

    Switched over to MPASM....now I have these errors:

    @ _config _HS_OSC & _BODEN_OFF & _PWRTE_ON & _WDT_ON

    For whatever reason it does not like the syntax of the above. Once I comment them out and compile, it has no errors. Putting them in produces errors specific to the items after the @. Is this the correct syntax?

    Nick

  2. #2
    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
    Switched over to MPASM....now I have these errors:

    @ _config _HS_OSC & _BODEN_OFF & _PWRTE_ON & _WDT_ON

    For whatever reason it does not like the syntax of the above. Once I comment them out and compile, it has no errors. Putting them in produces errors specific to the items after the @. Is this the correct syntax?

    Nick
    2 things, The config statement requires TWO UNDERSCORES __ without spaces between them,Like this @ __config and you will need to open the 16F877A.inc file (if that is the chip you are using), in the PBP Root directory and put a semicolon ; just prior to the MPASM DEFAULT CONFIG STATEMENT. This will cause PBP to ignore it as a comment, because your program can only use the one.
    Last edited by Archangel; - 30th April 2009 at 01:45.
    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.

  3. #3


    Did you find this post helpful? Yes | No

    Question

    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!

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

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

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

  7. #7


    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

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