using darrel taylor's instant interrupts


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Angry

    Now that I am declaring T2CON IN HEX that part is working, and I am not getting any more bad token errors. I see what you meant about the many warnings... Looks like I will have to spend more time debugging...

    Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F690 "PWMPROG.ASM" /l"PWMPROG.lst" /e"PWMPROG.err"
    Warning[205] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 769 : Found directive in column 1. (endm)
    Warning[206] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 770 : Found call to macro in column 1. (INT_CREATE)
    Warning[206] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 767 : Found call to macro in column 1. (INT_Handler)
    Warning[206] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 768 : Found call to macro in column 1. (INT_Handler)
    Warning[206] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 966 : Found call to macro in column 1. (MOVE?CT)
    Warning[203] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 967 : Found opcode in column 1. (MOVLW)
    Warning[203] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 968 : Found opcode in column 1. (ADDWF)
    Warning[203] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 969 : Found opcode in column 1. (BTFSC)
    Warning[203] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 970 : Found opcode in column 1. (INCF)
    Warning[203] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 971 : Found opcode in column 1. (MOVLW)
    Warning[203] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 972 : Found opcode in column 1. (ADDWF)
    Warning[206] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 973 : Found call to macro in column 1. (MOVE?CT)
    Warning[206] C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\PWMPROG.ASM 974 : Found call to macro in column 1. (INT_RETURN)
    Loaded C:\Documents and Settings\Admin\Desktop\PWMPROG.cod.
    BUILD SUCCEEDED: Mon Jul 30 13:24:24 2007

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


    Did you find this post helpful? Yes | No

    Default

    Be carefull with the spacing of ASM statements.

    In particular ... (quoted from Post #6)
    Code:
    ASM
    INT_LIST macro ' use the format IntSource, Label, Type, ResetFlag? 
    INT_Handler TMR1_INT, ReloadTMR1, ASM, no
    INT_Handler TMR1_INT, _MATHhandler, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM
    Should be ...
    Code:
    ASM
    INT_LIST macro ; use the format IntSource, Label, Type, ResetFlag? 
        INT_Handler TMR1_INT, ReloadTMR1, ASM, no
        INT_Handler TMR1_INT, _MATHhandler, PBP, yes
        endm
        INT_CREATE ; Creates the interrupt processor
    ENDASM
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Talking

    THANK YOU DT! I just came home from a strenuous day at the hospital...and that piece of information was very uplifting...I thought I would be banging my head for at least a month trying to solve those...

    IN CASE ANY OTHER NEWBIES ARE READING, HERE IS THE LAST PIECE OF CODE THAT HAD WRONG INDENTATION/SPACING AND HAS BEEN CORRECTED:

    ASM
    ReloadTMR1
    MOVE?CT 0, T1CON, TMR1ON ; 1 stop timer
    MOVLW LOW(TimerReload) ; 1 Add TimerReload to the
    ADDWF TMR1L,F ; 1 value in Timer1
    BTFSC STATUS,C ; 1/2
    INCF TMR1H,F ; 1
    MOVLW HIGH(TimerReload) ; 1
    ADDWF TMR1H,F ; 1
    MOVE?CT 1, T1CON, TMR1ON ; 1 start timer
    INT_RETURN
    ENDASM


    My code now compiles fine and i will have the chance to test it on the weekend. Apparrently i will have to buy a decent book on assembly after my next exam in october. Also I will clearly have to find a way to send beer to Darrell

  4. #4


    Did you find this post helpful? Yes | No

    Default

    UNFORTUNATELY IT IS NOT BEING DISPLAYED CORRECTLY HERE... JUST HAVE A QUICK LOOK at http://darreltaylor.com/DT_INTS-14/TimerTemplate.html

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


    Did you find this post helpful? Yes | No

    Default Yep!

    That's all it was, where do you learn those little tidbits short of having a great mentor, Ugh, OH GREAT ONE?
    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
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Post the “vB code” code box

    Great work Darrel!

    Hi Michael,

    Quote Originally Posted by Michael Wakileh View Post
    UNFORTUNATELY IT IS NOT BEING DISPLAYED CORRECTLY HERE... JUST HAVE A QUICK LOOK at http://darreltaylor.com/DT_INTS-14/TimerTemplate.html
    The forum will keep re-formatting your code. It removes spaces and changes things. To avoide this use the “vB code” code box.

    To use the “Code Brackets” see the “vB code” Hot button in the “Posting Rules” box at the bottom left of the screen while you are posting.

    It puts the code in the special box that protects the format better that the normal forum posting does...
    Hope that helps,
    -Adam-
    Ohm it's not just a good idea... it's the LAW !

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 23:14
  2. darrel taylor's instant interrupt compiler error
    By delta_boogie in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 20th October 2009, 20:07
  3. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  4. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  5. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48

Members who have read this thread : 1

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