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

    http://darreltaylor.com/DT_INTS-14/intro.html
    http://darreltaylor.com/DT_INTS-14/downloads.htm
    http://darreltaylor.com/DT_INTS-18/home.html

    Darrel's include files Require MPASM to work. Darrel Requires you not to copy paste the code into your code, rather use them as include files as I did. They exist in versions for the 14 bit core and for the 18F series. He has generously made these available to us, and I am grateful to him. THANKS DARREL !

    Quote Originally Posted by Macgman2000 View Post
    Also, Why is MPASM needed if the files are .bas ?
    Nick
    If you need help switching assemblers let me know, it's pretty easy.

    EDIT:
    Nick I think I set your code up with the wrong interrupt, I set it up as RBC_INT and that would be for on change interrupt whereas you want interrupt on portB.0 which should be INT_INT in the assy statement for INT_Handler .
    Last edited by Archangel; - 29th April 2009 at 23:41. Reason: ReEnterPBP-14.bas is in the .zip file
    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


    Did you find this post helpful? Yes | No

    Question

    I am getting a lot of errors. I unzipped the files in the PBP directory (same as PBP.exe). It shows up in the compiler includes column on the left side of microcode. I am using compiler 2.47.

    Errors in microcode studio:

    1). _config
    2). local directive use only in macro
    3). undefinded symbol 'iflagreg'
    4). numeric constant or symbol name expected
    5). ')' expected
    6). too many errors

    I am clueless as to why it is doing that. The include files from Darrel do not need any special modifications or set up....right?

    Nick

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Like Joe said ... you must be using MPASM as the assembler.
    <br>
    DT

  4. #4


    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

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

  6. #6


    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!

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

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